ExHarness.DialyzerRunner (ex_harness v0.1.3)

Copy Markdown View Source

Runs mix dialyzer in the host project and parses its short-format output into [%{file, line, kind, message}].

The runner never raises on a non-zero exit code: dialyzer exits with a non-zero status whenever findings exist, but for ex_harness those are normal data, not errors. Stderr/exit are captured for the caller.

Summary

Functions

Parse dialyzer's --format short output into findings.

Run dialyzer in root and return parsed findings.

Types

finding()

@type finding() :: %{
  file: String.t(),
  line: integer() | nil,
  kind: String.t(),
  message: String.t()
}

result()

@type result() :: %{
  findings: [finding()],
  summary: %{total: non_neg_integer()},
  exit_status: integer(),
  stderr: String.t() | nil
}

Functions

parse(output)

@spec parse(String.t()) :: [finding()]

Parse dialyzer's --format short output into findings.

run(root, opts \\ [])

@spec run(
  String.t(),
  keyword()
) :: result()

Run dialyzer in root and return parsed findings.

Options:

  • :quick — when true, skip mix dialyzer --plt rebuild and reuse whatever PLT already exists. Defaults to false.
  • :env — extra env vars passed to System.cmd/3.