slop/variant-files
No files named as copies or variants
| Severity | info |
| Tiers | all |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.5.0 |
| Selected by | fleetlint-slop@v0.5.0 |
Requirement
No file is named as a copy of another (handler-old.ts, config copy.json, notes(1).md), and no source file is a _v2 or _new variant of a file that is still tracked (client_v2.py next to client.py). Versioned API, routing, schema and migration files are not read.
Why
The history keeps old versions; a second file means nobody decided which one is current.
Check
For each item in:
tracked().filter(p,
p.matches(r'(_|-)(old|backup|copy|fixed|improved|enhanced)\.[a-z]+$|( copy|\([0-9]+\))\.[a-z]+$')
|| (p.matches(r'[_-](v[2-9]|new)\.(go|py|rs|ts|tsx|js|jsx|mjs|cjs|kt|kts|java|dart|swift|rb|php|cs|c|cc|cpp|h|hpp|vue|svelte|scala)$')
&& !p.matches(r'(?i)(^|/)[^/]*(api|openapi|swagger|schema|proto|route|router|routes|endpoint|migration)[^/]*$')
&& (p.substring(0, p.lastIndexOf(".") - (p.matches(r'[_-]new\.[a-z]+$') ? 4 : 3)) + p.substring(p.lastIndexOf("."))) in tracked()))falseFix
Keep one file under the original name and delete the other.
Agent instruction: Report the pair; do not delete either without confirming which is in use.
Sources
Generated by fleetlint docs from catalog v0.5.0.