dialyzer-configuration
$
npx mdskill add TheBushidoCollective/han/dialyzer-configurationConfigure Dialyzer to catch type errors and static analysis issues.
- Detects type mismatches, unreachable code, and unused tests in Elixir.
- Integrates with mix.exs and custom ignore files for project setup.
- Reads configuration options like plt_add_apps and error_handling flags.
- Generates reports on warnings and discrepancies for code quality.
SKILL.md
.github/skills/dialyzer-configurationView on GitHub ↗
---
name: dialyzer-configuration
user-invocable: false
description: Use when configuring Dialyzer for Erlang/Elixir type checking and static analysis.
allowed-tools: []
---
# Dialyzer Configuration
Dialyzer is a static analysis tool for Erlang and Elixir that identifies software discrepancies such as type errors, unreachable code, and unnecessary tests.
## Configuration Files
### dialyzer.ignore-warnings
```
# Ignore specific warnings
lib/my_module.ex:42:pattern_match_cov
```
### .dialyzer_ignore.exs
```elixir
[
{"lib/generated_code.ex", :no_return},
{~r/lib\/legacy\/.*/, :unknown_function}
]
```
### mix.exs Configuration
```elixir
def project do
[
app: :my_app,
dialyzer: [
plt_add_apps: [:mix, :ex_unit],
plt_core_path: "priv/plts",
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
flags: [:error_handling, :underspecs, :unmatched_returns],
ignore_warnings: ".dialyzer_ignore.exs",
list_unused_filters: true
]
]
end
```
## Common Configuration Options
### PLT Management
- `plt_add_apps`: Additional applications to include in PLT
- `plt_core_path`: Directory for core PLT files
- `plt_file`: Custom PLT file location
- `plt_add_deps`: Include dependencies (`:app_tree`, `:apps_direct`, `:transitive`)
### Analysis Flags
- `:error_handling` - Check error handling
- `:underspecs` - Warn on under-specified functions
- `:unmatched_returns` - Warn on unmatched return values
- `:unknown` - Warn on unknown functions/types
- `:overspecs` - Warn on over-specified functions
### Filter Options
- `ignore_warnings`: File with warning patterns to ignore
- `list_unused_filters`: Show unused ignore patterns
## Best Practices
1. **Incremental PLT Building**: Use project-specific PLTs to speed up analysis
2. **Gradual Adoption**: Start with subset of checks, expand over time
3. **CI Integration**: Run Dialyzer in continuous integration
4. **Type Specs**: Add comprehensive @spec annotations
5. **Warning Management**: Document intentional ignores
## Common Patterns
### Conditional Analysis
```elixir
if Mix.env() in [:dev, :test] do
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
end
```
### Custom Check Script
```bash
#!/bin/bash
mix dialyzer --format github
```
### GitHub Actions Integration
```yaml
- name: Run Dialyzer
run: mix dialyzer --format github
```
More from TheBushidoCollective/han
- absinthe-resolversUse when implementing GraphQL resolvers with Absinthe. Covers resolver patterns, dataloader integration, batching, and error handling.
- absinthe-schemaUse when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
- absinthe-subscriptionsUse when implementing real-time GraphQL subscriptions with Absinthe. Covers Phoenix channels, PubSub, and subscription patterns.
- act-docker-setupUse when configuring Docker environments for act, selecting runner images, managing container resources, or troubleshooting Docker-related issues with local GitHub Actions testing.
- act-local-testingUse when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues when running workflows on your local machine.
- act-workflow-syntaxUse when creating or modifying GitHub Actions workflow files. Provides guidance on workflow syntax, triggers, jobs, steps, and expressions for creating valid GitHub Actions workflows that can be tested locally with act.
- ameba-configurationUse when configuring Ameba rules and settings for Crystal projects including .ameba.yml setup, rule management, severity levels, and code quality enforcement.
- ameba-custom-rulesUse when creating custom Ameba rules for Crystal code analysis including rule development, AST traversal, issue reporting, and rule testing.
- ameba-integrationUse when integrating Ameba into development workflows including CI/CD pipelines, pre-commit hooks, GitHub Actions, and automated code review processes.
- analyze-performanceAnalyze performance metrics and identify slow transactions in Sentry