Conversation
LK
approved these changes
Feb 17, 2026
There was a problem hiding this comment.
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.
| writer.write_all(text.as_bytes())?; | ||
| writer.flush()?; | ||
| fs::rename(&tmp_path, path)?; | ||
| Ok(()) |
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Previously, layout sync wasn't quite idempotent. It was only idempotent after KiCad loads + saves the layout file and fixes the formatting. Now, it's really idempotent. This also eliminates the need for complex change detection + conditional patching. The logic is now much simpler: always patch board config and then format.
Note
Medium Risk
Changes how
.kicad_*files are rewritten during layout sync and introduces new formatting logic, so small formatting/ordering differences could create large diffs or expose parser/formatter edge cases despite added tests.Overview
Makes KiCad S-expression output deterministic and KiCad-style compliant by introducing a new
pcb_sexpr::formatter(prettify/format_tree) and switching schematic/symbol generation to use it.Simplifies
pcb layoutstackup/layer patching by removing approximate-diff/conditional updates and instead structurally mutating the parsed PCB S-expression, then always rewriting the board with canonical formatting (atomic buffered write).Extends
pcb fmtto optionally format a single explicit KiCad S-expression file path (with--check/--diffsupport via unified diffs), while keeping default/discovery behavior limited to.zenfiles; updates snapshots accordingly and addssimilaras a dependency.Written by Cursor Bugbot for commit 6eeaaca. This will update automatically on new commits. Configure here.