Caveats: It is possible that in some intricate uses of macros,
the automatic addition or removal of parentheses around uses or
arguments could cause the resulting program to be rejected by the
compiler; however, we have found no such case in existing
code. Programs defining strange macros can usually not be read by
this program, and in those cases, no changes will be made.

If you really, really want to, you may call it "Inga".

Disclaimer: The author accepts no responsibility for errors
introduced in code that has been processed by the program. It has
been reasonably well tested, but the possibility of errors remains.
Keep backups of your original code safely stored, until you feel
confident that the new, modified code can be trusted.

file(Name) -> ok

file(Name::filename(), Options::[term()]) -> ok

Specifies the file name suffix to be used when a backup
file is created; the default value is ".bak"
(cf. the backups option).

{backups, bool()}

If the value is true, existing files will be
renamed before new files are opened for writing. The new
names are formed by appending the string given by the
backup_suffix option to the original name. The
default value is true.

{dir, filename()}

Specifies the name of the directory in which the output
file is to be written. By default, the current directory is
used. If the value is an empty string, the current directory
is used.

{outfile, filename()}

Specifies the name of the file (without suffix) to which
the resulting source code is to be written. If this option is
not specified, the Name argument is used.

{printer, Function}

Function = (syntaxTree()) -> string()

Specifies a function for prettyprinting Erlang syntax trees.
This is used for outputting the resulting module definition.
The function is assumed to return formatted text for the given
syntax tree, and should raise an exception if an error occurs.
The default formatting function calls
erl_prettypr:format/2.

{test, bool()}

If the value is true, no files will be modified; this
is typically most useful if the verbose flag is enabled, to
generate reports about the program files without affecting
them. The default value is false.

module(Forms) -> syntaxTree()

module(Forms, Options::[term()]) -> syntaxTree()

Forms = syntaxTree() | [syntaxTree()]

syntaxTree() (see module erl_syntax)

Tidies a syntax tree representation of a module
definition. The given Forms may be either a single
syntax tree of type form_list, or a list of syntax
trees representing "program forms". In either case,
Forms must represent a single complete module
definition. The returned syntax tree has type
form_list and represents a tidied-up version of the
same source code.

Available options are:

{auto_export_vars, bool()}

If the value is true, all matches
"{V1, ..., Vn} = E" where E is a
case-, if- or receive-expression whose branches all return
n-tuples (or explicitly throw exceptions) will be rewritten
to bind and export the variables V1, ...,
Vn directly. The default value is false.

If the value is true, calls to lists:map/2 and
lists:filter/2 will be rewritten using list comprehensions.
The default value is true.

{file, string()}

Specifies the name of the file from which the source code
was taken. This is only used for generation of error
reports. The default value is the empty string.

{idem, bool()}

If the value is true, all options that affect how the
code is modified are set to "no changes". For example, to
only update guard tests, and nothing else, use the options
[new_guard_tests, idem]. (Recall that options closer to the
beginning of the list have higher precedence.)

{keep_unused, bool()}

If the value is true, unused functions will
not be removed from the code. The default value is
false.

{new_guard_tests, bool()}

If the value is true, guard tests will be updated to
use the new names, e.g. "is_integer(X)" instead of
"integer(X)". The default value is true. See also
old_guard_tests.

{no_imports, bool()}

If the value is true, all import statements will be
removed and calls to imported functions will be expanded to
explicit remote calls. The default value is false.

{old_guard_tests, bool()}

If the value is true, guard tests will be changed to
use the old names instead of the new ones, e.g.
"integer(X)" instead of "is_integer(X)". The default
value is false. This option overrides the new_guard_tests
option.

{quiet, bool()}

If the value is true, all information
messages and warning messages will be suppressed. The default
value is false.

{rename, [{{atom(), atom(), integer()},
{atom(), atom()}}]}

The value is a list of pairs, associating tuples
{Module, Name, Arity} with tuples {NewModule, NewName},
specifying renamings of calls to remote functions. By
default, the value is the empty list.

The renaming affects only remote calls (also when
disguised by import declarations); local calls within a
module are not affected, and no function definitions are
renamed. Since the arity cannot change, the new name is
represented by {NewModule, NewName} only. Only
calls matching the specified arity will match; multiple
entries are necessary for renaming calls to functions that
have the same module and function name, but different
arities.

This option can also be used to override the default
renaming of calls which use obsolete function names.

{verbose, bool()}

If the value is true, progress messages will be output
while the program is running, unless the quiet option is
true. The default value is false.