Sdlc/Structural/PrimitiveObsessedIvar: fix the masgn crash, count reads only, drop the config Exclude #1368
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1368
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The cop
Sdlc/Structural/PrimitiveObsessedIvarcrashes on multiple assignment, counts assignments as uses, and needs a config Exclude to stay quiet.Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
Observed
Crash:
plugins/os-sdlc/lib/os_sdlc/retired_test.rb:6@path, @method_name = .... An ivasgn inside an mlhs has no value child, soliteral_ivasgns.rb:22callshash_type?on a Symbol.False positive:
plugins/os/lib/worktree/start_command.rb:12.@linkedis reassigned in 2 defs and read in 1;reference_count.rb:19counts assignments as uses.False positive:
plugins/os-context/eval/bin/self-test:40.TranscriptBuilderalready is the object that owns@lines.A config Exclude hides cases at
.rubocop.yml:339-340.Reproduce
n/a: run the cop on
plugins/os-sdlc/lib/os_sdlc/retired_test.rb; the matcher is atplugins/os-sdlc/lib/os_sdlc/cops/primitive_obsessed_ivar.rb.Approach
Carve-outs go in the cop matcher, never in a config Exclude list or a test-path exclusion.
Skip an ivasgn that has no value child in
literal_ivasgns.rb.Count only
:ivarreads inreference_count.rb.Skip a class that is itself the builder or collector of the ivar.
Delete the
.rubocop.yml:339-340Exclude.Required work:
PrimitiveObsessedIvarin.rubocop.ymlAcceptance criteria
@a, @b = x, yininitialize, when the cop runs, then it does not crash.Origin
VERDICT: CREATE