forbid : Review.Rule.Rule
Reports when a variable between case .. of
is used in any of the cases
config =
[ VariablesBetweenCaseOf.AccessInCases.forbid
]
case arguments of
[] ->
"no arguments"
_ :: _ ->
arguments |> String.join ", "
The rule collects variables even inside tuples, variants and lists.
case arguments of
[] ->
"no arguments"
firstArg :: args1Up ->
(firstArg :: args1Up) |> String.join ", "
The rule does not collect variables inside records, functions, operations, ...
case originalList |> List.drop 4 of
[] ->
"less than 5 arguments"
_ :: _
originalList |> String.join ", "
This rule is not useful when you would fix
case list of
[] ->
"no arguments"
_ :: _ ->
list |> String.join ", "
to
case list of
[] ->
"no arguments"
list_ ->
list_ |> String.join ", "
That's not the purpose of this rule!
The motivation is preventing you from forgetting to use certain information and referring to the wrong variables. For more details, check the readme