Skip to content
New issue

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

no_match_in_condition reports a warning even when the condition includes a valid match #311

Open
elbrujohalcon opened this issue Mar 8, 2023 · 0 comments
Labels
Milestone

Comments

@elbrujohalcon
Copy link
Member

Bug Description

In the scenario below, the rule should not emit a warning.

To Reproduce

Run Elvis on…

-module(x).

-export([valid/1]).

valid(List) ->
    case lists:all(fun ({K, V}) ->
                           Something = find:something(for, K),
                           check:something(V, Something)
                   end,
                   List)
        of
        true -> all_true;
        false -> found_a_bad_one
    end.

You'll get…

# src/x.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.

Expected Behavior

No warnings.

@elbrujohalcon elbrujohalcon added this to the 3.0.1 milestone Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant