Skip to content

Move board-config/title-block patching to Rust#545

Merged
akhilles merged 4 commits intomainfrom
sexpr-fmt
Feb 17, 2026
Merged

Move board-config/title-block patching to Rust#545
akhilles merged 4 commits intomainfrom
sexpr-fmt

Conversation

@akhilles
Copy link
Contributor

@akhilles akhilles commented Feb 17, 2026

Note

Medium Risk
Changes affect deterministic generation and mutation of .kicad_pcb/.kicad_pro during layout sync, which could introduce formatting or settings drift across KiCad versions and existing projects despite added idempotency tests.

Overview
Moves KiCad board/project configuration patching out of the Python sync step and into Rust.

Layout sync now post-processes both .kicad_pcb and .kicad_pro: the PCB file is structurally patched and prettified to enforce a canonical title_block (with ${PCB_NAME}/${CURRENT_DATE}/${PCB_VERSION}) and to apply stackup/layer/thickness updates; the project file is patched via a new Rust kicad_project_patch module that idempotently upserts constraint fields, predefined track/via sizes (merging without deleting user entries), netclasses, and only netclass pattern assignments when such assignments exist.

Python update_layout_file.py is simplified by removing the SetupBoard/--board-config path and related orphan-cleanup logic, and pcb layout --check now also detects drift in the generated .kicad_pro in addition to the PCB file; release test suppression is updated accordingly.

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

&paths.pcb.with_extension("kicad_pro"),
config,
&netclass_assignments,
)?;
Copy link

Choose a reason for hiding this comment

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

Missing project file now aborts layout sync

Medium Severity

process_layout now always calls patch_project_file whenever board_config exists. patch_kicad_pro immediately reads *.kicad_pro, so runs fail if that file is missing. Since resolve_kicad_files can return a default path for non-existent projects and update_layout_file.py only creates *.kicad_pcb, fresh layouts with board_config can error out.

Additional Locations (1)

Fix in Cursor Fix in Web

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 merged commit a133329 into main Feb 17, 2026
12 checks passed
@akhilles akhilles deleted the sexpr-fmt branch February 17, 2026 17:33
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