mix def_layout.skipped (def_layout v0.1.1)

Copy Markdown View Source

Lists the module bodies DefLayout skips - the ones it leaves in source order rather than laying out.

mix def_layout.skipped [PATHS...]

With no arguments it reads the :inputs from your .formatter.exs, matching the files mix format would format. Pass file paths or globs to scan those instead.

Each skipped module is listed with its location and the reason it was skipped, one per line:

path:line: Module.Label - reason

A module is reported when DefLayout can't safely move its definitions - an expression or nested module interleaved among the functions, non-adjacent clauses of the same function, an unrecognized construct above the first def, a used macro below the first def, expansion-time code that calls one of the module's functions, or a keyword-form module body. Reporting is per module, including nested ones: an inner module can be skipped while its outer lays out, and the reverse. Already-laid-out modules are not reported. The reason echoes the README's "What gets skipped" vocabulary, so it indexes the section that explains why each case is skipped.

Summary

Functions

Returns a {path, line, label, reason} tuple for every skipped module body in source, in source order, descending through nested modules. line is the module node's source line and reason is the explanatory phrase.

Functions

skipped_modules(source, path)

@spec skipped_modules(String.t(), Path.t()) :: [
  {Path.t(), pos_integer(), String.t(), String.t()}
]

Returns a {path, line, label, reason} tuple for every skipped module body in source, in source order, descending through nested modules. line is the module node's source line and reason is the explanatory phrase.