Executes incremental Dialyzer runs directly via :dialyzer.run/1.
Summary
Functions
Runs incremental Dialyzer and returns structured diagnostics without printing.
Types
Functions
@spec analyze( Assay.Config.t(), keyword() ) :: %{ status: run_result(), warnings: [Assay.Ignore.entry()], ignored: [Assay.Ignore.entry()], ignore_path: binary() | nil, options: keyword(), timings: map() }
Runs incremental Dialyzer and returns structured diagnostics without printing.
This function is useful when you need programmatic access to Dialyzer results
without formatted output. It compiles the project (unless :no_compile is set),
runs Dialyzer, decorates warnings with metadata, and applies ignore rules.
Options
:no_compile- Whentrue, skip theMix.Task.run("compile")step. The project must already be compiled or Dialyzer will fail. Defaults tofalse.:quiet- Suppress informational output. Defaults tofalse.:formats- List of output format atoms. Defaults to[:text].:explain_ignores- Show details about ignored warnings. Defaults tofalse.:print_config- Print the effective Dialyzer configuration. Defaults tofalse.
Return Value
Returns a map with:
:status-:okif no warnings,:warningsif warnings found:warnings- List of visible (non-ignored) warning entries:ignored- List of ignored warning entries:ignore_path- Path to the ignore file used, ornil:options- Dialyzer options that were used
Examples
# Analyze with default options
config = Assay.Config.from_mix_project()
result = Assay.Runner.analyze(config)
result.status
# => :ok or :warnings
length(result.warnings)
# => number of visible warnings
# Analyze quietly (no output)
result = Assay.Runner.analyze(config, quiet: true)
# Returns same structure but without printing
# Skip compilation (project must already be compiled)
result = Assay.Runner.analyze(config, no_compile: true)
# Analyze with specific formats (for structured output)
result = Assay.Runner.analyze(config, formats: [:json])
# Then format warnings yourself
json_warnings = Enum.map(result.warnings, fn warning ->
Assay.Formatter.format([warning], :json, project_root: config.project_root)
end)
@spec run( Assay.Config.t(), keyword() ) :: run_result()