This is an attempt to define some consistent formatting rules for our Erlang code.
I made some research and I tested various options, so far the one that I prefer is erlfmt from WhatsApp. Like most non-builtin formatters, this is opinionated. But the choices they made are well thought, and seem to be a good starting point.
You have both the option to reformat the code inline:
rebar3 fmt
or check the formatting:
rebar3 fmt --check
This last command is especially useful for CI integration.
This is an attempt to define some consistent formatting rules for our Erlang code.
I made some research and I tested various options, so far the one that I prefer is erlfmt from WhatsApp. Like most non-builtin formatters, this is opinionated. But the choices they made are well thought, and seem to be a good starting point.
You have both the option to reformat the code inline:
or check the formatting:
This last command is especially useful for CI integration.