We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern-matching should not be used in case statement conditions, like this:
case
case #{a := A} = do:something() of #{b := good} -> {a, really, nice, A}; #{b := bad} -> {"not", a, good, A} end
YES
While the code as written above is valid, it's much harder to understand (particularly for large statements) than the one below.
case do:something() of #{a := A, b := good} -> {a, really, nice, A}; #{a := A, b := bad} -> {"not", a, good, A} end
Inspired by the Refactor.MatchInCondition rule from Credo
Refactor.MatchInCondition
The text was updated successfully, but these errors were encountered:
1fa2722
Merge pull request #304 from inaka/brujo.289.no_match_in_condition
d90a43b
Fix #289: New Rule: No match in conditions
elbrujohalcon
No branches or pull requests
No Match in Condition
Brief Description
Pattern-matching should not be used in
case
statement conditions, like this:Should be on by default?
YES
Options
Reasoning
While the code as written above is valid, it's much harder to understand (particularly for large statements) than the one below.
Refactoring Proposal
Origin (#281)
Inspired by the
Refactor.MatchInCondition
rule from CredoThe text was updated successfully, but these errors were encountered: