ExQuality.Stages.Credo (ExQuality v0.8.0)

View Source

Runs Credo static analysis on the codebase.

Executes mix credo --strict --format json (strictness is configurable) with MIX_ENV=dev, and turns each issue into an ExQuality.Finding.

JSON rather than the default output because credo's text format does not name the check that produced an issue, and because counting issues out of it meant five regexes against a summary line that a reader could not check. The count is now length(issues), and check is the check module (Credo.Check.Readability.ModuleDoc) rather than its category.

In an umbrella, each finding is tagged with the app its file belongs to, and the rendered output is grouped by app.

Output that does not parse is never hidden: a run that printed no JSON document is reported with whatever credo did say, which is what a version too old to know --format json produces.

Note: Credo does not support auto-fix. All issues must be manually resolved.

Summary

Functions

Runs the credo stage.

Functions

run(config)

@spec run(keyword()) :: ExQuality.Stage.result()

Runs the credo stage.

Config options

  • strict - Use --strict mode (default: true)
  • all - Use --all flag to check all files (default: false)