feat: add --skip-var-renames quick check - #41
Merged
Merged
Conversation
Fold C/C++ hunks that are only bindings differing by variable names, labelled `assumed-rename` instead of `real`. Unlike every other rule in the engine this one does not prove the difference is noise -- a rewiring has the same shape -- so it is opt-in, off by default, and announced in the terminal summary, the report, the JSON and the viewer title. A binding is one statement that names an object and at most copies a single other object or literal into it; either side may be a plain lvalue path (a.b, p->q, buf[2]), and a bare declaration counts. Still real: a changed literal or type, an ALL_CAPS macro/enum swap, a variable swap, and any hunk holding a line that is not a binding. Also drop the extra hint from report file headers: the header answers "must I read this file", and the verdict badge is that answer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
A new opt-in flag,
--skip-var-renames, for sweeping a regenerate to find what is not a rename.When a model update renames a wave of variables, the renames bury everything else. With this flag on, a C/C++ hunk whose every line is a binding differing only by variable names is folded as
assumed-renameinstead ofreal.A binding is one statement that names an object and at most copies a single other object or literal into it. Either side may be a plain lvalue path, which is how Embedded Coder reaches its ports and state:
Why this one is different
Every other rule in the engine proves the difference is noise before folding it. This one does not, and the repo rule says so: if a difference cannot be proven to be noise, it is a real change. A rewiring has exactly the same shape as a rename, so a run using this flag can be missing a real change.
That trade is the point of the flag, so it is contained rather than hidden:
assumed-rename— never spelledrenameon any surface;QUICK CHECKwarning above the counts;"quick_check": "skip-var-renames";QUICK CHECK: variable renames skipped.What still counts as a real change, even with the flag on
a = 0;→x = 1;sint32 a = 0;→uint8 x = 0;flag = FALSE;→flag = TRUE;,mode = IDLE;→mode = DRIVE;a↔b), however consistent it looksVerdicts, counts, exit codes and the ARXML/A2L path are untouched when the flag is absent.
Also in here
Report file headers now carry only the verdict badge. The
Affected: <fn>hint and the noise-kind list are gone — a header answers "must I read this file", and the badge is that answer. The enclosing function is still captioned above each hunk (ƒ Calc_step), and a revealed noise group's placeholder row still names its kind.Testing
tests/test_skip_var_renames.py(35 tests) covers the binding grammar, the map, the fold, every "still real" case above, and the four announcement surfaces.🤖 Generated with Claude Code