Skip to content

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
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261101T0701Z
Nov 1, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261101T0701Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7207 (slice 11). Same shape as #7393: dead_code for objective-c, solidity, zig and zscript now uses commented_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 later no longer matches.

  • objective-c: @interface|@implementation|if|NSLog via the helper (extra: @interface Foo : Bar); [obj msg]; and - (void)run kept as separate shapes.
  • solidity: function|contract|if|require|uint\d*|address (also fixes uint256 never matching uint\b); extra contract A is B.
  • zig: fn|const|var|pub|if|for|while|try|catch.
  • zscript: if|for|while|return|override|virtual|class (extra class Foo : Actor) plus A_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 --fast 9/9 pass. --ratchets not run separately (the golden bless was the ratchet this change moves).

Class / Sibling gaps

Class: dead_code rules 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 over languages/*.py for rules not using commented_keyword_statement.
Sibling gaps:

  • yacc: //|/* + if|for|while|return|%token, same mechanism; left for the next slice (4-language cap).
  • hlasm, pli, jcl, yaml, css, html, makefile, dockerfile, m4, scheme, bms, csd, agc_assembly, sqlite: matched by the file-list grep but not among the 43 prose-matching languages in the issue; need a per-language probe before conversion.
  • cobol, rexx, postgresql (via db2_sql): already converted/shaped in earlier slices.

Remaining slices

yacc (one file + test); then probe the non-listed languages above.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits November 1, 2026 02:17
…nt only when it has a statement's shape (Part of #7207)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 1, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 1, 2026 07:20
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 07:23
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant