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

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
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
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
pferriby
Introductory paragraph I’ll be looking for a keen junior or someone that has a couple of years experience in the real world (so you’ve be...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews