Runs the erlfmt
command for the given project. It's the most possible thin wrapper
to the original library. All the documentation can be found in the original library.
-v, --version
- returns the version of erlfmt being used-w, --write
- modify formatted files in place-o, --out
- output directory--verbose
- include debug output-c, --check
- check if your files are formatted. Get exit code 1
,--write
is not supported.--print-width
- the line length that formatter would wrap on--require-pragma
- require a special comment @format
, called a pragma,-i, --insert-pragma
- Insert a @format
pragma to the top of formatted files when pragma is absent.--require-pragma
,require-pragma
and insert-pragma
at the same time.--exclude-files
- files not to format. This overrides the files specified to format<files>
- files to format, -
for stdin. If no files are provided,-w
, -o
, -c
] are provided,{src,include,test}/*.{hrl,erl,app.src}
and rebar.config are specified as the default.You can configure common options inside erlfmt
section in you Mix
project.
It's structure is the same as for rebar.config
and can be got from erlfmt
docs.
defmodule MyApp.MixProject do
use Mix.Project
def project do
[
app: :my_app,
version: "0.0.1",
erlfmt: [print_width: 100]
]
end
end
This libraby is available in Hex, the package can be installed
by adding mix_erlfmt
to your list of dependencies in mix.exs
:
def deps do
[
{:mix_erlfmt, "~> 0.2.0"}
]
end
Documentation can is generated and published on HexDocs.