Skip to content

abap/ada/apex/dart dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7355

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261031T2122Z
Oct 31, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261031T2122Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7207 (slice 6). Follows #7341 (merged).

commented_keyword_statement(..., marker=, extra=) now drives abap, ada, apex and dart dead_code; a keyword-led comment counts only when the rest of the line has a statement's shape.

  • abap (* at line start, "): ends in . and holds an operator, an uppercase clause word (TYPE, FROM, INTO, EQ...) or a quote, or is a bare METHOD name. / DATA lv_name.. * write the total to the log. and * Data loaded. no longer count.
  • ada (--, not ---): ;, (...), :=, if ... then, for|while ... loop, a bare begin, or procedure|function|package|type Name is. -- end of the loop, -- type of the result no longer count. Rule now sets re.M (the shared shape uses ^ in a class; test_ada_caret_anchored_rules_all_set_multiline_flag).
  • apex (//, /*): ;{}, (...), an assignment, a bare [public|private] [with sharing] class Name [extends ...] or trigger Name, or a [SELECT ... FROM ...] query. // public API is stable, // update the record later no longer count.
  • dart (//, /*): the keyword half uses the helper plus a bare class|mixin Name [extends|with|implements|on ...]; the existing COMMENTED_STATEMENT_C_FAMILY alternative is unchanged.
  • Tests: test_script_dead_code_shape_7207.py gains 8 positives and 8 prose negatives per language, and the long-line test now uses each language's own marker. Existing abap/ada/apex/dart strict suites pass unchanged (523 pass).

Known losses (bare statement indistinguishable from prose): abap bare * WRITE lv_x. / * IF lv_flag.; ada -- end loop without ;; apex // update acc without ;; dart // return alone.

Goldens

Re-blessed both legs via golden-lock.sh crucible_check.py --update --yes. scope_check.py --base HEAD~1 --expect abap,ada,apex,dart: 659 differences per leg, attributed ada 414, dart 98, abap 37, plus 110 unattributed repo-wide rollup / per-file fields (dead-code and commented-logic consumers, fingerprint), the same shape as #7341. Apex has no pinned-corpus drift; no other language moved.

Gates

pr_gates --fast 9/9; --ratchets 9 pass, 0 skipped. Tree-wide guards pass. Not run: the full suite (CI's job); a translator-extra det run was not needed (no det code touched).

Class / Sibling gaps

Class: dead_code rules matching a bare comment marker + keyword (prose false positives), #7207. Members done across slices: cobol, c/cpp/java, csharp/typescript/javascript/rust, go/kotlin/swift, python/shell (#7335), ruby/perl/php/lua (#7341), and now abap, ada, apex, dart.
Remaining slices: none for this slice's four languages.
Sibling gaps: the rest of the issue's probe list, same mechanism with their own markers: acs, crystal, db2_sql, easytrieve, embedded_python, fortran, fsharp, groovy, haskell, livecode, matlab, objective-c, postgresql, powershell, rexx, scala, solidity, tcl, yacc, zig, zscript (21 languages).

Cross-repo: none.

Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 31, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 31, 2026 21:51
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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