-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
False positives for match
in RegexpMatch
#48
Comments
I believe #47 would fix this issue? |
I think that's a different issue. Let me put together a PR with a failing test and a suggested fix, it might take a day or three though. |
dduugg
added a commit
to dduugg/rubocop-performance
that referenced
this issue
May 4, 2019
dduugg
added a commit
to dduugg/rubocop-performance
that referenced
this issue
May 4, 2019
dduugg
added a commit
to dduugg/rubocop-performance
that referenced
this issue
May 4, 2019
I agree with this change. Thank you! |
dduugg
added a commit
to dduugg/rubocop-performance
that referenced
this issue
May 9, 2019
koic
added a commit
that referenced
this issue
May 10, 2019
[Fix #48] Fix RegexpMatch false positive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
RegexpMatch
is a bit too eager in flagging usage ofmatch
. Here's a simple example that is flagged when extending Rubocop's own API:I would suggest making the
match_method?
logic more selective, and only flag usage by receiver types known to have a regexp matchingmatch
method. At risk of getting too into implementation details, rather than:RegexpMatch
could instead do:I'm happy to open a PR if this is agreeable.
Expected behavior
The snippet above should not trigger a
Performance/RegexpMatch
violationActual behavior
Steps to reproduce the problem
rubocop file.rb --only Performance/RegexpMatch
with the above snippet saved infile.rb
RuboCop version
The text was updated successfully, but these errors were encountered: