You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The algorithm to detect matches in case conditions is too broad and it ends up emitting warnings for code that should actually be valid. In particular, anonymous functions or assignments to ignored variables (used as documentation).
#src/example.erl [FAIL]
- no_match_in_condition (https://github.com/inaka/elvis_core/tree/main/doc_rules/elvis_style/no_match_in_condition.md)
- Case statement with a match in its condition found on line 6.
- Case statement with a match in its condition found on line 16.
- Case statement with a match in its condition found on line 21.
Expected Behavior
#src/example.erl [FAIL]
- no_match_in_condition (https://github.com/inaka/elvis_core/tree/main/doc_rules/elvis_style/no_match_in_condition.md)
- Case statement with a match in its condition found on line 16.
Only the match in line 16 (i.e., A = do:something_with(1)) should raise an alert. The other two should be considered as valid code.
The text was updated successfully, but these errors were encountered:
Bug Description
The algorithm to detect matches in
case
conditions is too broad and it ends up emitting warnings for code that should actually be valid. In particular, anonymous functions or assignments to ignored variables (used as documentation).To Reproduce
Run Elvis on this module:
You'll get the following warnings:
Expected Behavior
Only the match in line
16
(i.e.,A = do:something_with(1)
) should raise an alert. The other two should be considered as valid code.The text was updated successfully, but these errors were encountered: