Repository navigation
assembly/fortran/haskell/livecode dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7393
Merged
Conversation
…ent only when it has a statement's shape (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…pe (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
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 10 (assembly, fortran, haskell, livecode). Copies the shape of merged slice 9 (#7381):
dead_codecounts a keyword-led comment only when the rest of the line has a statement's shape, viacommented_keyword_statement(marker=, extra=)from_shared_patterns.py.What changed
assembly.py: mnemonic plus operands (register or[mem]destination, symbol-likejmp/calltarget, pushed/popped register).; add the values togetherno longer counts.fortran.py:(...), assignment,if (..) then, barecall name/subroutine name.haskell.py:=binding,... where,import Mod,putStrLn "..."; the marker now excludes---and operator runs, and\s*(which could span a newline) is[ \t]*.livecode.py: camelCase handler header,end if,put <value> into,if <comparison> then,repeat with/for each/N times,set the X of Y to. Variable convention checked case-sensitively via(?-i:).test_script_dead_code_shape_7207.py: prose negatives and real-statement positives for all four (382 cases pass with the existing ones, plus the long-line ReDoS check).Golden re-bless
Via
golden-lock.sh crucible_check.py --update --yes.scope_check.py --base origin/main --expect assembly,fortran,haskell,livecode: assembly 637, livecode 331, fortran 100, haskell 10 differences; the other 169 are repo-wide rollup fields (column digests, groups, fingerprint) that those per-file changes move, as in #7381. No other language moved.Class / Sibling gaps
Class:
dead_coderules that match a comment marker plus a bare keyword with no check on what follows. Slices 1-9 are merged; this covers assembly, fortran, haskell, livecode (same mechanism, 4 files + test). Members handled: those four. Sibling gaps: (1) fortran^[cC*](F77 column-1 comment) has nore.M, so it only matches at the start of the file; fixing it widens counts beyond the shape rule, so it needs its own bless. (2) Bare single-word forms (; call foo,-- on mouseUplowercase,! call overhead) are ambiguous with prose and stay on the conservative side in assembly/livecode (missed rather than over-counted); fortran accepts a barecall name. (3) Any language whosedead_codeis still keyword-only after slices 1-10: re-run the sweep overlanguages/*.pyfordead_coderules not usingcommented_keyword_statement; not enumerated here.Gates
Targeted tests (
tests/extraction/languages -k "assembly or fortran or haskell or livecode or dead_code") pass; ruff format andruff checkclean on changed source. NOT run:pr_gates --fast/--ratchets(left to CI), per-language gauntlet beyond the matched tests.🤖 Generated with Claude Code