Sdlc/Minitest/TestMethodAfterPrivate: skip singleton test methods and match ::Minitest::Test #1358
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#1358
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
Rewritten 2026-10-27 from docs/lint-lessons/analyses/sdlc-minitest-test-method-after-private.md.
Sdlc/Minitest/TestMethodAfterPrivateflagsdef self.test_xafterprivate, butprivatedoes not change singleton methods. It missesclass C < ::Minitest::Test, because it comparesparent_class.sourcewith the string"Minitest::Test".Approach
Required work:
plugins/os-sdlc/lib/os_sdlc/cops/minitest/test_method_after_private.rb, report onlydefnodes, neverdefs— check: presentdef_type?inplugins/os-sdlc/lib/os_sdlc/cops/minitest/test_method_after_private.rbparent_class&.const_name == "Minitest::Test"— check: presentconst_nameinplugins/os-sdlc/lib/os_sdlc/cops/minitest/test_method_after_private.rbplugins/os-sdlc/tests/cops/test_method_after_private_test.rb: must-fire for a::Minitest::Testbase; must-pass fordef self.test_xafterprivateand fordef self.test_xwithprivate_class_method.Acceptance criteria
privatethendef self.test_xin aMinitest::Testclass, when the cop runs, then it reports no offense.privatethendef test_xin a class that inherits::Minitest::Test, when the cop runs, then it reports one offense.privatefixture, when the cop runs, then it still reports one offense.Owner sketch
Origin
defsand compares superclass source text ← DESIGN (test_method_after_private.rb:21-27)Skeptic DROP (depth-1, 0 hits today): proposed new cop Sdlc/Minitest/SingletonTestMethod —
def self.test_*ortest_*insideclass << selfin a Minitest::Test class never runs. Draft: docs/lint-lessons/analyses/sdlc-minitest-test-method-after-private.md question (b).Body rewritten 2026-10-27 from the false-positive process; analysis and lint lesson merged to main (docs/lint-lessons/analyses/, plugins/os-sdlc/lint-lessons/).
2026-10-27: work started in fast-batch-cop-matchers (AFK). Ticket confirmed valid on main
a02b9458.Follow-up cop Sdlc/Minitest/SingletonTestMethod (analysis option A) not filed. Skeptic DROP: 0 sites of def self.test_ in plugins/ and ~/dev/ruby-gems; speculative; depth-1 rule. Note here if it ever bites.
Resolution
Done: TestMethodAfterPrivate matches parent_class&.const_name == 'Minitest::Test' and reports def nodes only (defs skipped). Commit
748df9cf(mergedf5310f2b).Evidence: Fixtures: ::Minitest::Test base fires; private + def self.test_x passes; private_class_method passes; bare-private fixture still fires. Suite 2825 runs 0 failures; sweep 0 new hits.
Follow-ups: SingletonTestMethod cop dropped by skeptic: 0 sites. Lesson unchanged (already described singleton methods).