Expand description
Git-aware “changed files” filtering shared between fallow-cli and fallow-lsp.
Provides:
validate_git_reffor input validation at trust boundaries.ChangedFilesError/try_get_changed_files/get_changed_filesfor resolving a git ref into the set of changed files.filter_results_by_changed_filesfor narrowing anAnalysisResultsto issues in those files.filter_duplication_by_changed_filesfor narrowing aDuplicationReportto clone groups touching at least one changed file.
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§
- Changed
Files Error - Classification of a
git difffailure, 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
resultsto only include issues whose source file is inchanged_files. - get_
changed_ files - Get files changed since a git ref. Returns
Noneon git failure after printing a warning to stderr. Used by--changed-sinceand--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.