Credo.Check.Consistency.SpaceAroundOperators (Credo v1.5.0) View Source

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

Explanation

Use spaces around operators like +, -, * and /. This is the preferred way, although other styles are possible, as long as it is applied consistently.

# preferred

1 + 2 * 4

# also okay

1+2*4

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:

  • ignore: List of operators to be ignored for this check.

    Defaults to [:|]

Like with all checks, general params can be applied.

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