Hex version Hex downloads Hex docs License

ExQuality

ExQuality is one command, mix quality, that runs an Elixir project's quality tools in parallel and reports the whole gate in one shape. Each tool is one stage with a status, a one-line summary, and findings that carry a file:line, and the same results can be written as a JSON report for a script to route on.

Why: the output is the point

Every quality tool prints in its own format, at its own length, and says nothing when it did not run, so reading a gate made of several tools means reading several walls of text and inferring what is missing from them, and a script that wants to act on a failure has to parse each tool its own way. With ExQuality the gate is one run, one stream and one shape per stage: a passing stage costs one line, a skipped stage says why it was skipped, and a failure points at the file:line to fix.

What a run looks like

A mix quality run: green passing stages, dim skipped stages, and a red failing stage with its finding printed below

Colour is a second channel over the ✓, ○ and ✗, never a replacement for one. It is dropped when the output is not a terminal, so a CI log or a piped run reads exactly the same minus the paint.

Three properties follow from that, and they are what the tool is for:

Do not pipe a run through head, tail or grep. The output is already the minimum needed to act, and truncating it removes findings, not noise. If you want to route on a result rather than read it, ask for a JSON report.

Installation

def deps do
  [{:ex_quality, "~> 0.16", only: :dev, runtime: false}]
end

Then set up the tools you want to run:

mix deps.get
mix quality.init              # interactive; pre-selects credo, dialyzer, excoveralls
mix quality.init --skip-prompts

mix quality.init detects what is already installed, adds the rest to mix.exs, runs mix deps.get, writes each tool's config, and creates a .quality.exs. Nothing about it is required: ExQuality runs whatever the project already depends on.

Basic usage

mix quality --test-scope changed     # between edits: only the tests covering changed code
mix quality --quick                  # while coding: drops Dialyzer and the coverage threshold
mix quality                          # before committing, and in CI: the full gate
mix quality --report .quality.json   # the full gate, plus a JSON report to route on

A stage is enabled when the project depends on the tool behind it, so there is nothing to switch on for the common tools. --quick narrows which checks run; --test-scope narrows how much code they run over. Neither measures coverage, so neither is the full gate: run a bare mix quality for that. The flags, profiles and test scope are in Configuration.

Working with a coding agent

ExQuality ships a usage-rules.md for AI coding assistants, readable by usage_rules. It tells an agent which command to run for which situation, how to read a failure, not to truncate the output, and which fixes are never acceptable - lowering a coverage threshold, adding a .sobelow-conf ignore - because a tool silencing its own findings is a regression dressed as a pass.

Why one command with many speeds suits an agent loop, and how the full gate stays distinguishable from a narrowed one, is in Why the gate is one command.

Documentation

Compatibility

License

MIT

Contributing

Issues and pull requests welcome at github.com/riddler/ex_quality.