Skip to content

pcb layout stackup sync now also patches general (thickness ...)#544

Merged
akhilles merged 1 commit intomainfrom
sexpr-fmt
Feb 17, 2026
Merged

pcb layout stackup sync now also patches general (thickness ...)#544
akhilles merged 1 commit intomainfrom
sexpr-fmt

Conversation

@akhilles
Copy link
Contributor

@akhilles akhilles commented Feb 17, 2026

Also, only rewrite the subset of the layout file we're patching. Not the whole thing. We were already using this strategy for net rename and other Rust-based kicad file patching. We should use it for board config patching as well.


Note

Medium Risk
Touches layout file patching/formatting logic and changes how .kicad_pcb content is rewritten; errors could cause malformed boards or noisy diffs, though changes are localized and covered by new tests.

Overview
pcb layout stackup sync now also patches general (thickness ...) using a computed board thickness (including KiCad’s fixed solder mask contribution) and formats the value in KiCad-style mm text.

Stackup/layers syncing is refactored to generate a PatchSet that replaces only the relevant S-expression spans (layers, setup.stackup, and general.thickness) and then runs prettify, reducing unrelated churn compared to reformatting the entire parsed tree.

pcb-sexpr parsing/formatting is extended to preserve original numeric lexemes (e.g. 12.000000) via a new raw_atom field, ensuring round-trips and targeted patches don’t normalize unrelated numeric precision.

Written by Cursor Bugbot for commit d5d5a1c. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@akhilles akhilles requested a review from LK February 17, 2026 02:23
Also, only rewrite the subset of the layout file we're patching. Not the
whole thing. We were already using this strategy for net rename and
other Rust-based kicad file patching. We should use it for board config
patching as well.
@akhilles akhilles merged commit a74faa6 into main Feb 17, 2026
12 checks passed
@akhilles akhilles deleted the sexpr-fmt branch February 17, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants