Skip to content

embedded_python/fsharp/groovy/scala dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7360

Merged
squid-shepherd[bot] merged 4 commits into
mainfrom
churn/7207-20261031T2300Z
Nov 1, 2026
Merged

squid-shepherd[bot] merged 4 commits into
mainfrom
churn/7207-20261031T2300Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7207 (slice 8). dead_code for embedded_python, fsharp, groovy and scala counted a comment marker plus a bare keyword; it now counts one only when the rest of the line has a statement's shape, via commented_keyword_statement (marker=/extra=), copying #7355 / #7359.

Changes

  • embedded_python: same shape as python (# marker; (...), assignment, trailing :, import a.b [as c]).
  • groovy: ;{}, (...), assignment, Gradle implementation 'g:a:v' (also compile/api/testImplementation), bare class Name [extends ..], dotted import a.b.C.
  • fsharp (/// doc lines excluded): (...), assignment, if .. then, match .. with, printfn "...", let .. =, type|module Name [=], open Ns.Name.
  • scala: ;{}, (...), assignment, val x: Type, def f: Type, bare class|object|trait Name [extends ..], println "...", dotted import a.b._. Block-comment openers now apply to every keyword, not just def/val/class/object, matching the sibling rules.
  • test_script_dead_code_shape_7207.py: 8 positives and 8 prose negatives per language, plus the long-line ReDoS check.
  • Goldens re-blessed via golden-lock.sh crucible_check.py --update --yes; both fixtures move only in the same nine files earlier slices touched (dead-logic / commented-logic exposure, fingerprint, centroid distance, snapshots), by a few bytes.

Class / Sibling gaps

Class: dead_code rules that match a comment marker plus a bare statement keyword, so English prose comments count as commented-out code (#7207). Done in slices 1-7 (cobol; c/cpp/java; csharp/typescript/javascript/rust; go/kotlin/swift; python/shell; ruby/perl/php/lua; abap/ada/apex/dart), here (embedded_python, fsharp, groovy, scala) and in #7359 (acs, crystal, db2_sql, easytrieve, still open when this was written).
Sibling gaps (same mechanism, not in this PR; probe hits from the issue in brackets): assembly (3), fortran (9), haskell (2), livecode (3), matlab (3), objective-c (2), postgresql (3), powershell (3), rexx (3), solidity (1), tcl (3), yacc (8), zig (3), zscript (4). Each needs its own comment syntax and a test pair; the issue's Caveat applies (confirm with the language's own marker).
Remaining slices: two or three more of four languages each, same files (language modules, the shared test, a golden bless).

Cross-repo

No companion PRs. Golden overlap: #7359 also re-blesses the same fixture files and edits the same test file; whichever merges second needs git merge origin/main, take main's goldens, re-bless.

Gates

Shape test 233 passed; pr_gates --fast 9/9 pass (ruff 0.17.1 pinned); golden bless run in both legs via golden-lock.sh. --ratchets not run here (the dead_code change touches only the golden masters, which were blessed directly).

🤖 Generated with Claude Code

@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 02:47
@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

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 02:58
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 9127fe3 into main Nov 1, 2026
120 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/7207-20261031T2300Z branch November 1, 2026 03:15
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