Repository navigation
abap/ada/apex/dart dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7355
Merged
Conversation
…t has a statement's shape (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
Contributor
|
No description provided. |
This was referenced Oct 31, 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 6). Follows #7341 (merged).
commented_keyword_statement(..., marker=, extra=)now drives abap, ada, apex and dartdead_code; a keyword-led comment counts only when the rest of the line has a statement's shape.*at line start,"): ends in.and holds an operator, an uppercase clause word (TYPE,FROM,INTO,EQ...) or a quote, or is a bareMETHOD name./DATA lv_name..* write the total to the log.and* Data loaded.no longer count.--, not---):;,(...),:=,if ... then,for|while ... loop, a barebegin, orprocedure|function|package|type Name is.-- end of the loop,-- type of the resultno longer count. Rule now setsre.M(the shared shape uses^in a class;test_ada_caret_anchored_rules_all_set_multiline_flag).//,/*):;{},(...), an assignment, a bare[public|private] [with sharing] class Name [extends ...]ortrigger Name, or a[SELECT ... FROM ...]query.// public API is stable,// update the record laterno longer count.//,/*): the keyword half uses the helper plus a bareclass|mixin Name [extends|with|implements|on ...]; the existingCOMMENTED_STATEMENT_C_FAMILYalternative is unchanged.test_script_dead_code_shape_7207.pygains 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 loopwithout;; apex// update accwithout;; dart// returnalone.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 --fast9/9;--ratchets9 pass, 0 skipped. Tree-wide guards pass. Not run: the full suite (CI's job); atranslator-extra det run was not needed (no det code touched).Class / Sibling gaps
Class:
dead_coderules 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