slop/variant-names
No names with version or quality suffixes
| Severity | info |
| Tiers | all |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-slop@v0.3.1 |
Requirement
No declaration is a variant of another one that is still declared (parseV2 next to parse, handlerNew next to handler, ClientImproved next to Client). A suffixed name without a declared base (isNew, PolicyV2 alone) is not a finding.
Why
It means two implementations exist and callers must know which one is right.
Check
For each item in:
codegrep("code", r'\b(?:func(?:\s*\([^)]*\))?|fun|def|fn|function|class|struct|interface|type|void|const|final|let|var|val)\s+(\w+?)(?:V[2-9]|_v[2-9]|Improved|Enhanced|Old|New|Fixed|Better)\b')codegrep("code", r'\b(func(\s*\([^)]*\))?|fun|def|fn|function|class|struct|interface|type|void|const|final|let|var|val)\s+' + item.match + r'\b').size() == 0Fix
Change the original and update its callers; delete the other.
Agent instruction: Report the pair; merge into the original name only when the callers and tests make the intended behaviour clear.
See: https://fleetlint.org/baseline/#slop, https://fleetlint.org/slop/#code-structure
Generated by fleetlint docs from catalog v0.3.1.