Repository navigation
Python/Kotlin branch: match/case/when count only as statements, not method calls (#8034) - #8104
Conversation
…match( calls (Part of #8034) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #8104 @ ef70caa: 3 failed check(s) == shard 1 (1670027 LOC) (failure) -- real == shard 3 (1670389 LOC) (failure) -- real == shard 4 (1669847 LOC) (failure) -- real |
…h( branch hits (Part of #8034) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (d564b22) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
Closes #8034
What changed
Python
branchcountedmatchandcaseanywhere (re.match(...),self.p.match(t),match.group(1),case = 1). They are soft keywords, so they now count only as a statement: line start after indentation, a subject (not=:.,)]), and a:on the line. Same change inembedded_python.py(identical rule). Kotlinbranchno longer counts a.when(method call ((?<!\.)).Class / Sibling gaps
Class: a branch keyword that is also a legal identifier or method name is counted as a branch. Members handled here: Python
match/case(python + embedded_python, same rule), Kotlin.when(. Each has positive and negative tests (statement forms, method calls, assignments, annotations, dict keys, the_has_generator_bannershape from the issue giving exactly 5 hits).Sibling gaps (no burned-estate program needs any; all are
(?<!\.)-style fixes plus tests, sweep scope):.default/.case/.switchproperty names (javascript.py,typescript.py).default/caseas identifiers or member names.default/selectas identifiers.match/when(fsharp.py).selectas a word in arguments.Limitation: a
matchsubject continued past the line, or a statement after;, is not counted.Golden masters
Blessed via
golden-lock.sh crucible_check.py --update --yes(both legs): 65 files, 58 insertions. Drift is the Python/Kotlin branch drop plus its knock-on through risk scores, archetypes and the 3D layout coordinates (the layout is global, so languages not touched also shift by float noise;scope_check.py --expect python,embedded_python,kotlinshows that rollup).Gates
Strict tests for python, kotlin and embedded python pass (235);
audit_check.pyall clear;ruff format --checkclean. Not run locally:pr_gates --ratchets, tri-comparison and tree-sitter audits (left to CI).🤖 Generated with Claude Code