diff --git a/CHANGELOG.md b/CHANGELOG.md index d54bb08536..897a58d5d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +### Bug fixes + +* [#47](https://github.com/rubocop-hq/rubocop-performance/pull/47): This PR fixes a false negartive for `Performance/RegexpMatch` when using RuboCop 0.68 or higher. ([@koic][]) + ## 1.1.0 (2019-04-08) ### Changes diff --git a/lib/rubocop/cop/performance/regexp_match.rb b/lib/rubocop/cop/performance/regexp_match.rb index c98d9a715a..000485a039 100644 --- a/lib/rubocop/cop/performance/regexp_match.rb +++ b/lib/rubocop/cop/performance/regexp_match.rb @@ -86,8 +86,8 @@ class RegexpMatch < Cop def_node_matcher :match_method?, <<-PATTERN { + (send _recv :match _ ) (send _recv :match _) - (send _recv :match _ (int ...)) } PATTERN diff --git a/rubocop-performance.gemspec b/rubocop-performance.gemspec index bbc5fe160a..d61676459e 100644 --- a/rubocop-performance.gemspec +++ b/rubocop-performance.gemspec @@ -29,6 +29,6 @@ Gem::Specification.new do |s| 'bug_tracker_uri' => 'https://github.com/rubocop-hq/rubocop-performance/issues' } - s.add_runtime_dependency('rubocop', '>= 0.67.0') + s.add_runtime_dependency('rubocop', '>= 0.68.0') s.add_development_dependency('simplecov') end