Repository navigation
objective-c/solidity/zig/zscript dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7402
Merged
Conversation
…nt only when it has a statement's shape (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
This was referenced Nov 1, 2026
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.
Part of #7207 (slice 11). Same shape as #7393:
dead_codefor objective-c, solidity, zig and zscript now usescommented_keyword_statement, so a comment counts only when what follows the keyword has a statement's shape (;{}, a(...)group, an assignment, or a language-specific extra). Prose such as// if the user cancels, we retry,// try again later,// return value is ignored,// address the issue laterno longer matches.@interface|@implementation|if|NSLogvia the helper (extra:@interface Foo : Bar);[obj msg];and- (void)runkept as separate shapes.function|contract|if|require|uint\d*|address(also fixesuint256never matchinguint\b); extracontract A is B.fn|const|var|pub|if|for|while|try|catch.if|for|while|return|override|virtual|class(extraclass Foo : Actor) plusA_Name(.Tests: positives and prose negatives per language plus the long-line ReDoS check in
test_script_dead_code_shape_7207.py(444 pass).Goldens re-blessed with
golden-lock.sh crucible_check.py --update --yes.scope_check.py --expect zig,objective-c,solidity,zscript: 303 diffs: zig 202, objective-c 35, 66 unattributed rollup rows that are all zig GPU-JSON file hashes. No solidity or zscript corpus line changed.Gates:
pr_gates.py --fast9/9 pass.--ratchetsnot run separately (the golden bless was the ratchet this change moves).Class / Sibling gaps
Class:
dead_coderules that match a comment by keyword alone, so English prose counts as commented-out code (#7207). This PR covers objective-c, solidity, zig, zscript. Re-ran the sweep overlanguages/*.pyfor rules not usingcommented_keyword_statement.Sibling gaps:
//|/*+if|for|while|return|%token, same mechanism; left for the next slice (4-language cap).Remaining slices
yacc (one file + test); then probe the non-listed languages above.
🤖 Generated with Claude Code