ALL-DUPL0002 · evidence
This page continues ALL-DUPL0002 directly from its source docstring. Read its implementation.
Evidence
Section titled “Evidence”Each finding cites every path and line, the exact role, occurrence and file counts, and the narrowest common directory as a candidate ownership boundary. That boundary can own a named domain value, enum, constrained type, or API policy. The rule proposes no automatic edit because choosing the representation and public owner requires domain knowledge.
Exceptions
Section titled “Exceptions”Ordinary assignments, return values, positional arguments, dictionary values, f-strings,
docstrings, chained comparisons, dynamic call targets, and unequal roles are excluded.
Comparisons against the interpreter-owned __name__ module sentinel are excluded because their
literal belongs to Python’s execution protocol rather than a project-owned policy. Keyword
values passed to a resolved standard-library module are excluded because that module owns the
value vocabulary. Comparisons against standard-library module names follow the same rule. Model
constructors and Pydantic calls are also excluded because values such as
model_validator(mode="after") and Field(alias="schema") should stay visible at their
declaration rather than become indirect constants. Calls to model_dump retain literal
serialization modes for the same reason. Other third-party and project operations remain
eligible because repeated choices there can still encode project policy. The repository’s Git
ignore files decide whether generated and vendored paths exist in this scan, and per-rule globs
can narrow that source set further. Equal text in different keyword names, callables, compared
operands, operators, or operand positions does not form one group. Short values remain local
unless the project lowers minimum_length for a domain where a short token carries stable
policy meaning.
References
Section titled “References”- Cites “The Python Standard Library”,
astfor calls, keywords, comparisons, and constants. Open reference - Cites “Refactoring”, Replace Magic Literal. Open reference