Skip to main content

Module changed_files

Module changed_files 

Source
Expand description

Git-aware “changed files” filtering shared between fallow-cli and fallow-lsp.

Provides:

Both filters intentionally exclude dependency-level issues (unused deps, type-only deps, test-only deps) since “unused dependency” is a function of the entire import graph and can’t be attributed to individual changed files.

Enums§

ChangedFilesError
Classification of a git diff failure, so callers can pick their own wording (soft warning vs hard error) without re-parsing stderr.

Functions§

filter_duplication_by_changed_files
Filter a duplication report to only retain clone groups where at least one instance belongs to a changed file. Families, mirrored directories, and stats are rebuilt from the surviving groups so consumers see consistent, correctly-scoped numbers.
filter_results_by_changed_files
Filter results to only include issues whose source file is in changed_files.
get_changed_files
Get files changed since a git ref. Returns None on git failure after printing a warning to stderr. Used by --changed-since and --file, where a failure falls back to full-scope analysis.
try_get_changed_files
Get files changed since a git ref. Returns Err (with details) when the git invocation itself failed, so callers can choose between warn-and-ignore and hard-error behavior.
validate_git_ref
Validate a user-supplied git ref before passing it to git diff.