ExHarness.Audit (ex_harness v0.1.3)

Copy Markdown View Source

Pure functions that render an audit report from dialyzer + reach results.

The renderer never touches the file system. Mix tasks pass the collected results in and write the returned string.

Summary

Functions

Renders the audit report as Markdown.

Renders the audit report as JSON-serialisable map.

Types

dialyzer_result()

@type dialyzer_result() :: %{findings: [map()], summary: map()} | nil

metadata()

@type metadata() :: %{
  :root => String.t(),
  :timestamp => DateTime.t(),
  optional(:elixir) => String.t(),
  optional(:otp) => String.t(),
  optional(:lock_digest) => String.t() | nil
}

reach_result()

@type reach_result() :: %{scope: map(), taints: [map()], dead_code: [map()]} | nil

Functions

render(metadata, dialyzer, reach)

@spec render(metadata(), dialyzer_result(), reach_result()) :: String.t()

Renders the audit report as Markdown.

to_json(metadata, dialyzer, reach)

@spec to_json(metadata(), dialyzer_result(), reach_result()) :: map()

Renders the audit report as JSON-serialisable map.