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

[Fix #8466] Fix a false positive for Lint/UriRegexp #8467

Merged
merged 1 commit into from Aug 6, 2020

Conversation

koic
Copy link
Member

@koic koic commented Aug 6, 2020

Fixes #8466.

This PR fixes a false positive for Lint/UriRegexp when using regexp method without receiver.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

Fixes rubocop#8466.

This PR fixes a false positive for `Lint/UriRegexp`
when using `regexp` method without receiver.
Copy link
Contributor

@wata727 wata727 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@koic koic merged commit 7acbdb8 into rubocop:master Aug 6, 2020
@koic koic deleted the fix_false_positive_for_uri_regexp branch August 6, 2020 15:14
@lopopolo
Copy link

lopopolo commented Aug 6, 2020

@koic uses of MatchData#regexp are false positives as well

https://ruby-doc.org/core-2.7.0/MatchData.html#method-i-regexp

lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 6, 2020
koic added a commit to koic/rubocop that referenced this pull request Aug 6, 2020
Follow rubocop#8467 (comment).

This PR fixes false positive for `Lint/UriRegexp`
when using `regexp` with variable receiver.
@koic koic mentioned this pull request Aug 6, 2020
8 tasks
@koic
Copy link
Member Author

koic commented Aug 6, 2020

@lopopolo Oops. I've opened #8476 for the fixing. Thank you for your feedback!

bbatsov pushed a commit that referenced this pull request Aug 7, 2020
Follow #8467 (comment).

This PR fixes false positive for `Lint/UriRegexp`
when using `regexp` with variable receiver.
lopopolo added a commit to artichoke/artichoke that referenced this pull request Aug 11, 2020
Remove unnecessary disable of RuboCop `Lint/UriRegexp` lint in `MatchData#==`.

I reported this upstream in rubocop/rubocop#8467 (comment)
and the bug was fixed in rubocop/rubocop#8476.
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

Successfully merging this pull request may close these issues.

False positives on Lint/UriRegexp cop
3 participants