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

Warning not filtered by regex #443

Open
dantswain opened this issue Oct 5, 2021 · 0 comments
Open

Warning not filtered by regex #443

dantswain opened this issue Oct 5, 2021 · 0 comments

Comments

@dantswain
Copy link

Precheck

  • Take a look at the open issues and be sure that your issue is not already covered. ✅
  • Be sure your versions of Dialyxir and Erlex are up to date. ✅

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir 1.11.0, Erlang/OTP 23

  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.1.0 (erlex is 0.2.6)

Current behavior

I'm getting a warning that doesn't make sense (an else clause from a with construct, but that's a separate issue) that I'd like to ignore. I have tried adding a regex to my dialyzer ignore file and I'm seeing weird behavior wrt that regex actually filtering the warning.

Here is the warning (somewhat redacted):

# --format dialyzer
lib/foo_server.ex:49: The pattern {'error', 'not_found'} can never match the type {'error','some_error1' | 'some_error2'}
# --format raw
{:warn_matching, {'lib/foo_server.ex', 49}, {:pattern_match, ['pattern {\'error\', \'not_found\'}', '{\'error\',\'some_error1\' | \'some_error2\'}']}}

It seems whenever I include any subset of not_found in the regex, it does not work ("work" == "ignores the warning"). Here are some regexes that do/do not work:

  • ~r/foo_server\.ex/ - works
  • ~r/foo_server\.ex.*pattern/ - works
  • ~r/foo_server\.ex.*pattern.*never match/ - works
  • ~r/foo_server\.ex.*pattern.*not/ - does not work
  • ~r/foo_server\.ex.*pattern.*not_found/ - does not work

Expected behavior

I would have expected all of these regexes to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant