python/source-derived-name
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Python | warning | none, edit by hand | All versions |
Name a declaration or a string option in Literal[...] after its purpose. Rename a function, class, parameter, variable or option that contains a configured source word and update its uses.
[tool.xpd.references]name-paths = ["src", "tests"]banned-words = ["webel", "mstl"]surname-directory = "papers"title-acronym-paths = ["src"]All keys are optional. Paths are files or directories relative to the project file. Without name-paths, the rule checks the project. Without any source words, it is off.
The rule adds the leading lowercase surname from immediate subdirectories named like webel2025study to the explicit word list. The surname must have at least four letters followed by four digits. It also collects acronyms that open quoted titles in numpydoc References sections under title-acronym-paths, such as "MSTL: A Seasonal-Trend ...".
Matching ignores case and splits snake case and camel case into words. A source word of six or more characters also matches within the name after underscores are removed.
Diagnostic message
Section titled “Diagnostic message”Rename the declaration or Literal value to describe its purpose and update its uses.See all rules in the Python pack.