Credo.Check.Refactor.PipeChainStart (Credo v1.5.0) View Source

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

Explanation

Pipes (|>) can become more readable by starting with a "raw" value.

So while this is easily comprehendable:

list
|> Enum.take(5)
|> Enum.shuffle
|> pick_winner()

This might be harder to read:

Enum.take(list, 5)
|> Enum.shuffle
|> pick_winner()

As always: This is just a suggestion. Check the configuration options for tweaking or disabling this check.

Configuration parameters

Use the following parameters to configure this check:

  • excluded_functions: All functions listed will be ignored.

    Defaults to []

  • excluded_argument_types: All pipes with argument types listed will be ignored.

    Defaults to []

Like with all checks, general params can be applied.

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