e.fu

e.fu

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? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New
kip
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews