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
Lint/DuplicateMatchPattern
Given the following case statement:
case x in "a" if false in "a" end
Lint/DuplicateMatchPattern should not be reported because of the guard clause
cop.rb:3:4: W: Lint/DuplicateMatchPattern: Duplicate in pattern detected. in "a" ^^^
echo 'case x\nin "a" if false\nin "a"\nend' > fp.rb && bx rubocop fp.rb
❯ bx rubocop -V 1.50.0 (using Parser 3.2.2.0, rubocop-ast 1.28.0, running on ruby 3.2.2) [arm64-darwin22] - rubocop-rails 2.19.0
The text was updated successfully, but these errors were encountered:
[Fix rubocop#11787] Fix a false positive for `Lint/DuplicateMatchPatt…
8c8a58f
…ern` Fixes rubocop#11787 This PR fixes a false positive for `Lint/DuplicateMatchPattern` when repeated `in` patterns but different `if` guard is used.
[Fix #11787] Fix a false positive for Lint/DuplicateMatchPattern
cc232d9
Fixes #11787 This PR fixes a false positive for `Lint/DuplicateMatchPattern` when repeated `in` patterns but different `if` guard is used.
Successfully merging a pull request may close this issue.
Given the following case statement:
Expected behavior
Lint/DuplicateMatchPattern
should not be reported because of the guard clauseActual behavior
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: