Skip to main content

Module files

Module files 

Source
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_target because the docstring pass runs ast.parse, and adding a language must never widen that filter.
is_scan_target
Any registered language’s source file - the file class drep check reads.
owning_command
The subcommand that does analyze path, if any.
redirect_hint
What to tell a user who named path at the wrong command.
walk_targets
Walk root and collect every regular file matching predicate.