erlalign (erlalign v0.1.3)
View SourceErlang code formatter that applies column alignment on top of erlfmt output
ErlAlign mirrors ExAlign's functionality for Erlang source code, enabling readable column-aligned formatting similar to Go's gofmt
Summary
Functions
Align case/if arrows: Pattern -> Body
Align consecutive variable assignments: Var = value
Format Erlang source contents with column alignment Opts may include
Load global configuration from ~/.config/erlalign/.formatter.exs
Main CLI entry point. Parses arguments and runs the formatter Calls erlang:halt/1 with appropriate exit code
Set default value for trim_eol_ws option if not already set Default is true (trim trailing whitespace)
Trim trailing whitespace from all lines if trim_eol_ws option is true
Functions
Align case/if arrows: Pattern -> Body
Align consecutive variable assignments: Var = value
Format Erlang source contents with column alignment Opts may include:
line_length(integer, default 98): Maximum line length for alignmenteol_at_eof(:add,:remove, ornil, defaultnil): Controls end-of-file newline handling With:add, a trailing newline is added if not present With:remove, any trailing newline is removed Withnil, the end-of-file newline is left unchangedkeep_separators(boolean, defaultfalse):trim_eol_ws(boolean, defaulttrue): Whentrue, trim trailing whitespace from end of lines
-spec init(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
Load global configuration from ~/.config/erlalign/.formatter.exs
Main CLI entry point. Parses arguments and runs the formatter Calls erlang:halt/1 with appropriate exit code
Set default value for trim_eol_ws option if not already set Default is true (trim trailing whitespace)
Trim trailing whitespace from all lines if trim_eol_ws option is true