MetaCredo. Git
(MetaCredo v0.4.0)
View Source
Lightweight git helpers for diff-based analysis.
Resolves the list of changed files between two git refs so that
mix metacredo --diff can scope analysis to only modified code.
Summary
Functions
Returns the list of files changed between base and head refs.
Like changed_files/2 but raises on error.
Returns the git repository root for the given path, or nil.
Functions
Returns the list of files changed between base and head refs.
Only files that still exist on disk are returned (added, copied, modified, renamed -- not deleted).
Options
:base- Base git ref (default:"origin/main"):head- Head git ref (default:"HEAD"):filter- Git diff filter string (default:"ACMR"):extensions- Optional list of extensions to keep (e.g.[".ex", ".py"])
Examples
iex> MetaCredo.Git.changed_files("/path/to/repo")
{:ok, ["lib/foo.ex", "lib/bar.ex"]}
Like changed_files/2 but raises on error.
Returns the git repository root for the given path, or nil.