From e3c374b9b159cfc041b208d569597e45e5af57a9 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 26 Aug 2021 12:00:45 +0900 Subject: [PATCH] Remove redundant `TargetRubyVersion` Follow up to #232. This commit removes redundant `TargetRubyVersion` because RuboCop Performance already drops Ruby 2.4 or lower. --- docs/modules/ROOT/pages/cops_performance.adoc | 6 ------ lib/rubocop/cop/performance/delete_prefix.rb | 3 --- lib/rubocop/cop/performance/delete_suffix.rb | 3 --- .../cop/performance/redundant_equality_comparison_block.rb | 3 --- 4 files changed, 15 deletions(-) diff --git a/docs/modules/ROOT/pages/cops_performance.adoc b/docs/modules/ROOT/pages/cops_performance.adoc index ba26936283..a2131126db 100644 --- a/docs/modules/ROOT/pages/cops_performance.adoc +++ b/docs/modules/ROOT/pages/cops_performance.adoc @@ -542,8 +542,6 @@ Model.select(:value).count == Performance/DeletePrefix -NOTE: Required Ruby version: 2.5 - |=== | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged @@ -616,8 +614,6 @@ str.sub!(/^prefix/, '') == Performance/DeleteSuffix -NOTE: Required Ruby version: 2.5 - |=== | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged @@ -1238,8 +1234,6 @@ end == Performance/RedundantEqualityComparisonBlock -NOTE: Required Ruby version: 2.5 - |=== | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged diff --git a/lib/rubocop/cop/performance/delete_prefix.rb b/lib/rubocop/cop/performance/delete_prefix.rb index 998b7543af..815608aad7 100644 --- a/lib/rubocop/cop/performance/delete_prefix.rb +++ b/lib/rubocop/cop/performance/delete_prefix.rb @@ -47,9 +47,6 @@ module Performance class DeletePrefix < Base include RegexpMetacharacter extend AutoCorrector - extend TargetRubyVersion - - minimum_target_ruby_version 2.5 MSG = 'Use `%s` instead of `%s`.' RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze diff --git a/lib/rubocop/cop/performance/delete_suffix.rb b/lib/rubocop/cop/performance/delete_suffix.rb index 6559b44792..969b2d2710 100644 --- a/lib/rubocop/cop/performance/delete_suffix.rb +++ b/lib/rubocop/cop/performance/delete_suffix.rb @@ -47,9 +47,6 @@ module Performance class DeleteSuffix < Base include RegexpMetacharacter extend AutoCorrector - extend TargetRubyVersion - - minimum_target_ruby_version 2.5 MSG = 'Use `%s` instead of `%s`.' RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze diff --git a/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb b/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb index d1ef3db49a..983292f6e6 100644 --- a/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb +++ b/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb @@ -24,9 +24,6 @@ module Performance # class RedundantEqualityComparisonBlock < Base extend AutoCorrector - extend TargetRubyVersion - - minimum_target_ruby_version 2.5 MSG = 'Use `%s` instead of block.'