e.fu

e.fu

dialyzer_json – Structured JSON output for Dialyzer warnings

dialyzer_json

dialyzer_json is an Elixir library that runs Dialyzer and emits its warnings as
structured JSON, enriched with metadata and fix hints. The goal is to make
Dialyzer output easier to consume programmatically by tools such as AI code
editors, CI systems, and custom analysis pipelines.

Motivation

Dialyzer’s standard output is optimized for humans reading a terminal, for
example:

lib/foo.ex:42:no_return
Function bar/2 has no local return.

While readable, this format is difficult for tools to reliably parse and reason
about. In particular, it makes it hard to:

  • Reliably extract file, line, and function information
  • Identify warning types programmatically
  • Prioritize which warnings to fix first
  • Group, filter, or stream warnings

What dialyzer_json provides

dialyzer_json introduces a new Mix task:

mix dialyzer.json

This task runs Dialyzer and outputs warnings as structured JSON, including:

  • File, line, column, module, and function
  • Dialyzer warning type
  • Human-readable message
  • A fix hint to help prioritize the warning
  • A summary section for aggregation and reporting

Example output:

{
  "metadata": {
    "schema_version": "1.0",
    "dialyzer_version": "5.4",
    "elixir_version": "1.19.4",
    "otp_version": "28",
    "run_at": "2026-02-02T07:00:03Z"
  },
  "warnings": [
    {
      "file": "lib/foo.ex",
      "line": 42,
      "column": 5,
      "function": "bar/2",
      "module": "Foo",
      "warning_type": "no_return",
      "message": "Function has no local return",
      "fix_hint": "code"
    }
  ],
  "summary": {
    "total": 1,
    "by_type": { "no_return": 1 },
    "by_fix_hint": { "code": 1 }
  }
}

Fix hints

Each warning includes a fix_hint field intended to help with prioritization:

  • code — Likely a real bug (e.g. unreachable code, impossible patterns)
  • spec — Typespec mismatch; code is probably correct, the @spec is not
  • pattern — Usually safe to ignore (e.g. third-party behaviours)

Useful flags

# Quick health check
mix dialyzer.json --quiet --summary-only

# Group warnings by type
mix dialyzer.json --quiet --group-by-warning

# Group warnings by file
mix dialyzer.json --quiet --group-by-file

# Filter to specific warning types
mix dialyzer.json --quiet --filter-type no_return --filter-type call

# JSONL output (one warning per line)
mix dialyzer.json --quiet --compact

Integration notes

dialyzer_json is designed to work alongside dialyxir. It reuses dialyxir’s PLT
building and invokes :dialyzer.run/1 directly to collect raw warnings before
formatting them.

Installation

def deps do
  [
    {:dialyzer_json, "~> 0.1.0", only: [:dev, :test], runtime: false}
  ]
end

def cli do
  [preferred_envs: ["dialyzer.json": :dev]]
end

Links

Hex package: dialyzer_json | Hex
Documentation: dialyzer_json v0.2.1 — Documentation

https://github.com/ZenHive/dialyzer_json

Where Next?

Popular in Announcing Top

Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement