Repository navigation
go/kotlin/swift dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7322
Conversation
…ent only when it has a statement's shape (Part of #7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…#7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…churn/7207-20261031T1506Z
…as 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]>
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
#7207) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (9d19fde) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
|
PR #7322 @ 9d19fde: 9 failed check(s) == db2 (cancelled) -- infra == db2 ${{ matrix.shard }} (cancelled) -- infra == det (failure) -- real == equivalence-e2e (failure) -- infra == measure (shard ${{ matrix.shard }}/${{ matrix.total }}) (cancelled) -- infra == runner-tests (cancelled) -- infra == shard ${{ matrix.group }}/${{ needs.plan.outputs.splits }} (cancelled) -- infra == shard ${{ matrix.shard }} (cancelled) -- infra == shard ${{ matrix.shard }} (${{ matrix.loc }} LOC) (cancelled) -- infra |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
Part of #7207 (slice 3: go, kotlin, swift).
Stacked on #7319 (csharp/typescript/javascript/rust, branch
churn/7207-20261031T1444Z, not yet on main): this branch merges it and reuses its helpercommented_keyword_statement. Retarget/merge after #7319 lands; until then the diff vs main also shows slice 2.What changed
dead_codein go, kotlin and swift was//+ bare keyword, so prose ("// if the user cancels, we retry", "// return value is ignored") counted as commented-out code. Each now usescommented_keyword_statement(<same keywords>, block=False): the keyword must be followed by a statement-shaped line (ends in;{}or a(...)group, or holds an assignment incl.:=). Markers and keyword lists are unchanged (//only, as before).Files (hand-written, 4 of this slice):
languages/go.py,kotlin.py,swift.py,tests/extraction/languages/test_native_dead_code_shape_7207.py(prose negatives + real commented-out-statement positives per language, plus a long-line speed pin). Goldens regenerated.File-cap exception: stacked on #7319, whose 5 hand-written files appear in the diff against main until it lands; this slice adds 4 (go.py, kotlin.py, swift.py, one test).
Golden re-bless
golden-lock.sh crucible_check.py --update --yes, both legs.scope_check.py --base origin/churn/7207-20261031T1444Z --mode both --expect go,kotlin,swift: drift is go 227, swift 23, plus repo-wide rollup fields (60) and 106 rows labelleddockerfilethat are.gofiles under the mobydockerfile/directory (e.g.versioning.go), i.e. Go. No kotlin rows moved (no commented-out keyword-led prose in the kotlin corpus samples). No other language moved.Class / Sibling gaps
Class: keyword-led comment counted as dead code without a statement shape (#7207's 43 matching languages). Done: cobol (#7296), c/cpp/java (#7307), csharp/typescript/javascript/rust (#7319), go/kotlin/swift (this PR).
Known trade-off in this slice: a keyword-led line with no terminator or call/assignment (
// import "fmt",// import Foundation,// return x) no longer counts.Sibling gaps (not here: other families, each a per-language syntax decision): abap, acs, ada, apex, assembly, crystal, dart, db2_sql, easytrieve, embedded_python, fortran, fsharp, groovy, haskell, livecode, lua, matlab, objective-c, perl, php, postgresql, powershell, python, rexx, ruby, scala, shell, solidity, tcl, yacc, zig, zscript (list from #7207, not re-verified here).
Remaining slices: those families, one checklist per family.
🤖 Generated with Claude Code