Skip to content

Commit

Permalink
Recover Ruby 2.4 code analysis using TargetRubyVersion: 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed May 15, 2022
1 parent 6738d9a commit ddbdd1a
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 ddbdd1a

Please sign in to comment.