efmt
An Erlang code formatter.
Features
- Opinionated: only maximum line length is configurable by users
- Emacs Erlang Mode friendly indentation
- Preserves non-whitespace tokens of the original text as-is
- Ensures the code after formatting keeps the same semantic meaning
- Provides a rebar3 plugin: rebar3_efmt
- Thorough macro support (MACRO_AND_PREPROCESS.md)
An Formatting Example
Before
After
Please refer to FORMAT_RULES.md about the formatting style.
Installation
Usage
Editor Integrations
TODO
Comparison with other formatters
erlfmt
- formatting style
- error handling
- macro handling
- formatting speed
- development phase
Limitations
There are some limitations that are not planned to be addressed in the future:
- Only supports UTF-8 files
- Doesn't process parse transforms
- That is, if a parse transform has introduced custom syntaxes in your Erlang code,
efmtcould fail
- That is, if a parse transform has introduced custom syntaxes in your Erlang code,