ALL-CONF0001 · hardcoded_path_policy_count
Count hardcoded path-discovery policies in Python collections.
This is a deterministic rule for all languages. Read its implementation.
Definition
Section titled “Definition”Inspect simple assignments to names whose normalized words include exclude, excluded,
ignore, ignored, directory, directories, suffix, or suffixes. Report only list,
tuple, and set literals containing at least three strings, and read every entry for whether it
is a filesystem path at all. Directory collections may contain safe path components. Suffix
collections must contain dotted suffixes or suffix globs. Other policy names require at least
one explicit separator, glob, hidden-name, or suffix marker.
An entry written as a regular expression is not a path, whatever the name around it says. The same words this rule matches also name the pattern tables a project hands to a coverage reporter, a linter, or a rename step, and those entries carry backslash escapes, anchors, alternation, groups, and repetition that no path and no glob has. Reading the entries settles that where a table of known tool keys only postpones it, because every tool spells its own key differently while every regular expression is written the same way. An entry reading as a pattern therefore votes for nothing, and a collection holding only patterns is a pattern table rather than a path policy.
Continue with evidence and references, or open the examples.