Skip to content

Commit

Permalink
Merge pull request #288 from koic/recover_ruby_24_analysis
Browse files Browse the repository at this point in the history
Recover Ruby 2.4 code analysis using `TargetRubyVersion: 2.4`
  • Loading branch information
koic authored May 17, 2022
2 parents 6738d9a + c7ba54e commit 11dd588
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 353 deletions.
1 change: 1 addition & 0 deletions changelog/fix_recover_ruby_24_analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#288](https://github.com/rubocop/rubocop-performance/pull/288): Recover Ruby 2.4 code analysis using `TargetRubyVersion: 2.4`. ([@koic][])
3 changes: 3 additions & 0 deletions lib/rubocop/cop/performance/delete_prefix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module Performance
class DeletePrefix < Base
include RegexpMetacharacter
extend AutoCorrector
extend TargetRubyVersion

minimum_target_ruby_version 2.5

MSG = 'Use `%<prefer>s` instead of `%<current>s`.'
RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze
Expand Down
3 changes: 3 additions & 0 deletions lib/rubocop/cop/performance/delete_suffix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module Performance
class DeleteSuffix < Base
include RegexpMetacharacter
extend AutoCorrector
extend TargetRubyVersion

minimum_target_ruby_version 2.5

MSG = 'Use `%<prefer>s` instead of `%<current>s`.'
RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module Performance
#
class RedundantEqualityComparisonBlock < Base
extend AutoCorrector
extend TargetRubyVersion

minimum_target_ruby_version 2.5

MSG = 'Use `%<prefer>s` instead of block.'

Expand Down
Loading

0 comments on commit 11dd588

Please sign in to comment.