View Source Recode.Task.EnforceLineLength (Recode v0.7.2)

The EnforceLineLength task writes multiline expressions into one line if they do not exceed the maximum line length.

Options

  • :skip - specifies expressions to skip.
  • :ignore - specifies expressions to ignore.

Examples

The following code is not changed by the Elixir Formatter.

fn
  x ->
    {
      :ok,
      x
    }
end

The EnforceLineLength task rewrite this to

fn x -> {:ok, x} end

and with the option [ignore: :fn] to

fn
  x -> {:ok, x}
end

and with the option skip: :fn the code keeps unchanged.