From dialyzer
Guides Dialyzer integration for Elixir projects: local/incremental analysis, CI/CD (GitHub Actions/GitLab), IDEs (VS Code/Vim), pre-commit hooks, shared PLTs.
npx claudepluginhub thebushidocollective/han --plugin dialyzerThis skill cannot use any tools. It operates in read-only mode without the ability to modify files or execute commands.
Integrating Dialyzer into development workflow and CI/CD pipelines.
Guides Dialyzer setup for Erlang/Elixir static analysis, including mix.exs config, PLTs, flags, ignore warnings, best practices, and GitHub Actions integration.
Reviews Elixir code for performance issues including GenServer bottlenecks, memory usage, concurrency patterns, and database N+1 queries. Use for high-throughput code or debugging slowdowns.
Verifies Elixir/Phoenix changes by discovering tools from mix.exs and .check.exs, then running compile, format, credo, dialyzer, sobelow, and tests (unit auto, E2E confirmed). Use before PRs or after fixes.
Share bugs, ideas, or general feedback.
Integrating Dialyzer into development workflow and CI/CD pipelines.
# Install dialyxir
mix deps.get
# Build initial PLT (takes time first run)
mix dialyzer --plt
# Run analysis
mix dialyzer
# Only analyze changed files
mix dialyzer --incremental
# Force rebuild PLT
mix dialyzer --clean
name: Dialyzer
user-invocable: false
on: [push, pull_request]
jobs:
dialyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.15'
otp-version: '26'
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
- name: Restore PLT cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
run: mix deps.get
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Run Dialyzer
run: mix dialyzer --format github
dialyzer:
stage: test
script:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix dialyzer
cache:
paths:
- _build/
- deps/
- priv/plts/
{
"elixirLS.dialyzerEnabled": true,
"elixirLS.dialyzerFormat": "dialyxir_long",
"elixirLS.dialyzerWarnOpts": [
"error_handling",
"underspecs",
"unmatched_returns"
]
}
{
"elixir.dialyzer.enabled": true
}
# lefthook.yml
pre-commit:
commands:
dialyzer:
glob: "*.ex"
run: mix dialyzer --incremental
#!/bin/sh
# .git/hooks/pre-commit
echo "Running Dialyzer..."
mix dialyzer --incremental --quiet
if [ $? -ne 0 ]; then
echo "Dialyzer found issues. Commit aborted."
exit 1
fi
# mix.exs
def project do
[
dialyzer: [
plt_core_path: "priv/plts",
plt_local_path: "priv/plts",
plt_add_apps: [:mix, :ex_unit],
# Shared across team via git
plt_file: {:no_warn, "priv/plts/project.plt"}
]
]
end
# Generate baseline
mix dialyzer > dialyzer_baseline.txt
# Check for new warnings
mix dialyzer | diff - dialyzer_baseline.txt
def project do
[
dialyzer: [
flags: [:error_handling],
# Use multiple cores
plt_add_deps: :app_tree
]
]
end
# Only check specific paths
mix dialyzer lib/critical/ test/important_test.exs
# Much faster after initial run
mix dialyzer --incremental
# lib/custom_dialyzer_formatter.ex
defmodule CustomDialyzerFormatter do
def format(warnings) do
warnings
|> Enum.map(&format_warning/1)
|> Enum.join("\n")
end
defp format_warning(warning) do
# Custom formatting logic
end
end
# Count warnings over time
mix dialyzer | grep -c "warning:" >> dialyzer_metrics.log
# Remove and rebuild
rm -rf _build/dev/*.plt priv/plts/*.plt
mix dialyzer --plt
# Increase VM memory
elixir --erl "+hms 4096" -S mix dialyzer
# Use incremental mode
mix dialyzer --incremental
# Or analyze subset
mix dialyzer lib/core/