Sdlc/Structural/RequireRelativeDensity: count only project-local requires #1385
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#1385
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
Sdlc/Structural/RequireRelativeDensitycounts gemrequirecalls toward Max (15). Its fix is to replace the manual load list with Zeitwerk. Zeitwerk keeps gem requires, so a file over Max because of gem requires still offends after the fix.Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
Observed
The lesson names the false positives: mostly-gem require lists and intentional manifests such as a test helper (lint-lessons/sdlc-structural-require-relative-density.yml:18-19). The real hit
plugins/cc-architect/scripts/plugin_config/plugin_config.rb:4is a true hit.Reproduce
n/a: a file with 16 top-level gem
requirelines offends and has no Zeitwerk fix.Approach
Fix by shape. Put the change in the cop matcher, never in a config Exclude list.
Required work:
require_relative, plusrequireof paths inside the project. Do not count gem requires.Acceptance criteria
requirecalls and norequire_relative, when the cop runs, then it reports no offense.require_relativecalls, when the cop runs, then it reports an offense.Origin
VERDICT: CREATE