Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/WhatsApp/eqwalizer
A type-checker for Erlang
https://github.com/WhatsApp/eqwalizer
Last synced: 10 days ago
JSON representation
A type-checker for Erlang
- Host: GitHub
- URL: https://github.com/WhatsApp/eqwalizer
- Owner: WhatsApp
- License: apache-2.0
- Created: 2022-06-22T08:57:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T08:05:05.000Z (18 days ago)
- Last Synced: 2024-10-29T15:31:58.396Z (10 days ago)
- Language: Scala
- Homepage:
- Size: 2.07 MB
- Stars: 513
- Watchers: 28
- Forks: 28
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ccamel - WhatsApp/eqwalizer - A type-checker for Erlang (Scala)
README
# eqWAlizer
A type-checker for Erlang.
## Using it with rebar3 projects
1. Use OTP 26
2. Download the `elp` binary for your system from https://github.com/WhatsApp/erlang-language-platform/releases> On 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.3. Add `eqwalizer_support` dependency and `eqwalizer_rebar3` plugin
to your rebar3 project definition (see below)
4. From the project directory run:
- `elp eqwalize ` to type-check a single module
- `elp eqwalize-all` to type-check all `src` modules in the projectAdding `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"}}
]}.
```## Using it with non-rebar projects
1. Use OTP 26 (it will be detected automatically by eqWAlizer)
2. Download the `elp` binary for your system from https://github.com/WhatsApp/erlang-language-platform/releases
3. Write a `project.json` file describing your project, see below for the file structure.
Ensure `eqwalizer_support` is added as a dependency, and that its `ebin` folder is reachable and populated
with `.beam` files.
4. From the project directory, assuming your `.json` file is called `project.json` run:
- `elp eqwalize --project project.json` to type-check a single module
- `elp eqwalize-all --project project.json` to type-check all `src` modules in the projectThe `.json` file should be structured in this way:
```
{
"apps": [app list],
"deps": [app list], // 3rd party dependencies (not type-checked), 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 []
}
```## FAQ
Please refer to [the FAQ document](./FAQ.md) 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?## Where can I learn more about eqWAlizer, its technical principles, its relation to dialyzer and elixir support feasibility?
[here](https://www.beamrad.io/35).
## License
eqWAlizer is [Apache licensed](./LICENSE).