Module rebar3_formatter

Automatic formatter for Erlang modules.

This module defines the rebar3_formatter behaviour.
Required callback functions: init/2, format_file/3.

Description

Automatic formatter for Erlang modules

Data Types

opts()

opts() = #{output_dir => none | current | file:filename_all(), encoding => none | epp:source_encoding(), action => verify | format, term() => term()}

result()

result() = changed | unchanged

t()

abstract datatype: t()

Function Index

action/1The action that the formatter will perform.
format_file/2Format a file.
ignore/2Process an ignored file.
new/3Build a formatter.

Function Details

action/1

action(X1::t()) -> verify | format

The action that the formatter will perform.

format_file/2

format_file(File::file:filename_all(), Formatter::t()) -> result()

Format a file. Apply formatting rules to a file containing erlang code.

ignore/2

ignore(File::file:filename_all(), X2::t()) -> ok

Process an ignored file. If output dir is not the current one we need to copy the files that we are not formatting to it

new/3

new(Module::module(), Opts::opts(), RebarState::undefined | rebar_state:t()) -> t()

Build a formatter.


Generated by EDoc