Expand description
The only file-target policy.
Every code path in drep that decides which files to look at goes through
these predicates, so a Python file is a file is a file regardless of whether
it was discovered by a full scan, the staged-files index, or a
--diff <ref> query. Markdown has its own predicate and its own command:
see is_scan_target for why the two file classes are disjoint.
Walking is the ignore crate rather than std::fs::read_dir so a project’s
gitignore is honoured without a second pass, and vendored directories are
pruned during the walk (rather than collected-then-filtered, which would
stat every entry under node_modules/ before discarding them).
Discovery of explicit filenames (drep check a.rs .) deliberately ignores
gitignore: the user naming a path is a stronger signal than a repo-wide
pattern. expand_paths enforces that; walk_targets enforces the inverse.
Structs§
- Expansion
- The result of resolving a command’s path arguments.
Enums§
- Rejected
- Why an explicitly named path produced no target.
Functions§
- expand_
named - Resolve a command’s path arguments against
root. - expand_
paths - Expand a list of explicit paths (files and/or directories) into a sorted,
deduplicated set of files matching
predicate. - is_
ignored_ dir - A directory that should never be descended into.
- is_
markdown - Markdown document.
- is_
python_ source - Python source file. Kept distinct from
is_scan_targetbecause the docstring pass runsast.parse, and adding a language must never widen that filter. - is_
scan_ target - Any registered language’s source file - the file class
drep checkreads. - owning_
command - The subcommand that does analyze
path, if any. - redirect_
hint - What to tell a user who named
pathat the wrong command. - walk_
targets - Walk
rootand collect every regular file matchingpredicate.