From f1d087c0ba3a9f2a50e92f73371e4522baddd27f Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 12 Feb 2024 11:58:29 -0500 Subject: [PATCH] Reduce minimum RuboCop version back to `~> 1.51` Since we're introducing the <% if rubocop_version >= "X.YZ" Dept/Cop: Enabled: true <% end %> approach to configuring RuboCop without requiring a specific version of the gem (ahead of supporting plugin configs), we should just use that approach to avoid changing the minimum required version in the next release. --- Gemfile.lock | 2 +- rubocop-shopify.gemspec | 2 +- rubocop.yml | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5dd215a9..7800a95c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rubocop-shopify (2.14.0) - rubocop (~> 1.53) + rubocop (~> 1.51) GEM remote: https://rubygems.org/ diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index 22ae4946..4fba6d45 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -23,5 +23,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.7.0" - s.add_dependency("rubocop", "~> 1.53") + s.add_dependency("rubocop", "~> 1.51") end diff --git a/rubocop.yml b/rubocop.yml index 867de810..1360af9c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -202,8 +202,10 @@ Lint/LiteralAssignmentInCondition: Enabled: true <% end %> +<% if rubocop_version >= "1.53" %> Lint/MixedCaseRange: Enabled: true +<% end %> Lint/MixedRegexpCaptureTypes: Enabled: false @@ -238,8 +240,10 @@ Lint/RaiseException: Lint/RedundantDirGlobSort: Enabled: false +<% if rubocop_version >= "1.53" %> Lint/RedundantRegexpQuantifiers: Enabled: true +<% end %> Lint/RedundantRequireStatement: Enabled: false @@ -726,8 +730,10 @@ Style/RandomWithOffset: Style/RedundantArgument: Enabled: false +<% if rubocop_version >= "1.52" %> Style/RedundantArrayConstructor: Enabled: true +<% end %> Style/RedundantAssignment: Enabled: false @@ -741,8 +747,10 @@ Style/RedundantConditional: Style/RedundantConstantBase: Enabled: true +<% if rubocop_version >= "1.53" %> Style/RedundantCurrentDirectoryInPath: Enabled: true +<% end %> Style/RedundantDoubleSplatHashBraces: Enabled: true @@ -756,8 +764,10 @@ Style/RedundantFetchBlock: Style/RedundantFileExtensionInRequire: Enabled: false +<% if rubocop_version >= "1.52" %> Style/RedundantFilterChain: Enabled: true +<% end %> Style/RedundantHeredocDelimiterQuotes: Enabled: true @@ -768,14 +778,18 @@ Style/RedundantInitialize: Style/RedundantLineContinuation: Enabled: true +<% if rubocop_version >= "1.53" %> Style/RedundantRegexpArgument: Enabled: true +<% end %> Style/RedundantRegexpCharacterClass: Enabled: false +<% if rubocop_version >= "1.52" %> Style/RedundantRegexpConstructor: Enabled: true +<% end %> Style/RedundantRegexpEscape: Enabled: false @@ -801,8 +815,10 @@ Style/RescueStandardError: Style/ReturnNil: Enabled: true +<% if rubocop_version >= "1.53" %> Style/ReturnNilInPredicateMethodDefinition: Enabled: true +<% end %> Style/SelectByRegexp: Enabled: false @@ -874,8 +890,10 @@ Style/UnpackFirst: Style/WordArray: EnforcedStyle: brackets +<% if rubocop_version >= "1.53" %> Style/YAMLFileRead: Enabled: true +<% end %> Style/YodaCondition: Enabled: false