A type-checker for Erlang.
-
Use OTP 25
-
Download the
elp
binary for your system from https://github.com/WhatsApp/eqwalizer/releasesOn Mac you will probably get the following message when trying to run the executable the first time: "elp cannot be opened because the developer cannot be verified.". To solve this, go to Preferences > Security and Privacy and add an exception. Alternatively, you can build elp from source.
-
Add
eqwalizer_support
dependency andeqwalizer_rebar3
plugin to your rebar3 project definition (see below) -
From the project directory run:
elp eqwalize <module>
to type-check a single moduleelp eqwalize-all
to type-check allsrc
modules in the project
Adding eqwalizer_support
and eqwalizer_rebar3
:
{deps, [
{eqwalizer_support,
{git_subdir,
"https://github.com/whatsapp/eqwalizer.git",
{branch, "main"},
"eqwalizer_support"}}
]}.
{project_plugins, [
{eqwalizer_rebar3,
{git_subdir,
"https://github.com/whatsapp/eqwalizer.git",
{branch, "main"},
"eqwalizer_rebar3"}}
]}.
- Use OTP 25 (it will be detected automatically by eqWAlizer)
- Download the
elp
binary for your system from https://github.com/WhatsApp/eqwalizer/releases - Write a
project.json
file describing your project, see below for the file structure. Ensureeqwalizer_support
is added as a dependency, and that itsebin
folder is reachable and populated with.beam
files. - From the project directory, assuming your
.json
file is calledproject.json
run:
elp eqwalize <module> --project project.json
to type-check a single moduleelp eqwalize-all --project project.json
to type-check allsrc
modules in the project
The .json
file should be structured in this way:
{
"apps": [app list],
"deps": [app list], // 3rd party dependencies (not type-checked), defaults to []
"root": "path/to/root" // Defaults to ""
}
where an app
is a map structured as such:
{
"name": "app_name",
"dir": "path/to/app", // Relative to project root
"src_dirs": ["path/to/src", ...], // Relative to app dir, defaults to ["src"]
"extra_src_dirs": ["path/to/extra_src", ...], // Relative to app dir, defaults to []
"ebin": "path/to/ebin", // Relative to app dir, defaults to "ebin"
"include_dirs": ["include", ...], // Relative to app dir, defaults to []
"macros": ["MACRO", ...], // Defaults to []
}
As an example, see the build_info.json file used to test mini-elp.
Please refer to the FAQ document for answers to some common questions, including:
- What's the difference between eqWAlizer and Dialyzer?
- Why not extend Dialyzer, rather than creating a new tool?
- What about Elixir?
eqWAlizer is Apache licensed.