mix metacredo (MetaCredo v0.3.4)

View Source

Runs MetaCredo checks on your project.

Usage

$ mix metacredo
$ mix metacredo --path lib/my_module
$ mix metacredo --strict
$ mix metacredo --only security,warning
$ mix metacredo --format json
$ mix metacredo --format github
$ mix metacredo --diff
$ mix metacredo --diff --base origin/develop --head HEAD
$ mix metacredo --config path/to/.metacredo.exs
$ mix metacredo explain MetaCredo.Check.Security.HardcodedValue

Path

The --path option restricts analysis to a specific file or directory. When omitted, the current directory (.) is used, with excluded patterns from the configuration still applied.

$ mix metacredo --path lib/
$ mix metacredo --path lib/my_app/accounts.ex

Diff Mode

When --diff is given, only files changed between --base (default: origin/main) and --head (default: HEAD) are analyzed. This is ideal for CI pipelines where you only want to check new or modified code in a pull request.

GitHub Actions Format

Use --format github to emit GitHub Actions workflow commands that produce inline PR annotations:

::error file=lib/foo.ex,line=42::Security issue found