Credo.Check.Consistency.SpaceInParentheses (Credo v1.5.0-rc.4) View Source

This check has a base priority of high and works with any version of Elixir.

Explanation

Don't use spaces after (, [, and { or before }, ], and ). This is the preferred way, although other styles are possible, as long as it is applied consistently.

# preferred

Helper.format({1, true, 2}, :my_atom)

# also okay

Helper.format( { 1, true, 2 }, :my_atom )

While this is not necessarily a concern for the correctness of your code, you should use a consistent style throughout your codebase.

Configuration parameters

Use the following parameters to configure this check:

  • allow_empty_enums: Allows [], %{} and similar empty enum values to be used regardless of spacing throughout the codebase.

    Defaults to false

Parameters can be configured via the .credo.exs config file.

Link to this section Summary

Link to this section Functions

Link to this function

do_run_on_source_file(exec, source_file, params)

View Source