From 9ea8b775c0ba24e65f2ff45fa47bfb4aee9e553d Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 10 Jun 2020 09:52:20 +0100 Subject: [PATCH 1/6] Enable support for cops introduced by 0.85 Namely: - `Lint/MixedRegexpCaptureTypes` - `Style/RedundantRegexpCharacterClass` (disabled by default due to https://github.com/rubocop-hq/rubocop/issues/8098) - `Style/RedundantRegexpEscape` --- CHANGELOG.md | 5 +++++ gc_ruboconfig.gemspec | 4 ++-- rubocop.yml | 11 +++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6acb2c1..3059de4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +2.15.0 +------ +* Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape` + and `Style/RedundantRegexpCharacterClass` (disabled by default) + 2.14.0 ------ * Enable a new cop introduced by rubocop v0.84: `Lint/DeprecatedOpenSSLConstant` diff --git a/gc_ruboconfig.gemspec b/gc_ruboconfig.gemspec index 3f1e7ca..4b253e5 100644 --- a/gc_ruboconfig.gemspec +++ b/gc_ruboconfig.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = 'gc_ruboconfig' - spec.version = '2.14.0' + spec.version = '2.15.0' spec.summary = "GoCardless's shared Rubocop configuration, conforming to our house style" spec.authors = %w[GoCardless] spec.homepage = 'https://github.com/gocardless/ruboconfig' @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.files = 'rubocop.yml' - spec.add_dependency 'rubocop', '>= 0.84' + spec.add_dependency 'rubocop', '>= 0.85' spec.add_dependency 'rubocop-rspec', '>= 1.38.1' spec.add_dependency 'rubocop-performance', '~> 1.5' end diff --git a/rubocop.yml b/rubocop.yml index f8c3842..4153d9c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -24,6 +24,9 @@ Lint/RaiseException: Lint/StructNewOverride: Enabled: true +Lint/MixedRegexpCaptureTypes: + Enabled: true + Metrics/ClassLength: Enabled: false @@ -171,5 +174,13 @@ Style/ExponentialNotation: Style/SlicingWithRange: Enabled: true +# Re-enable this when the following is resolved: +# https://github.com/rubocop-hq/rubocop/issues/8098 +Style/RedundantRegexpCharacterClass: + Enabled: false + +Style/RedundantRegexpEscape: + Enabled: true + Lint/DeprecatedOpenSSLConstant: Enabled: true From 499444c936a17a7d9ad462510f74cecf8cb457d3 Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 8 Jul 2020 14:51:58 +0100 Subject: [PATCH 2/6] Enable Style/RedundantRegexpCharacterClass The outstanding issue in Rubocop has now been fixed. --- CHANGELOG.md | 2 +- rubocop.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3059de4..f28022e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Changelog 2.15.0 ------ * Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape` - and `Style/RedundantRegexpCharacterClass` (disabled by default) + and `Style/RedundantRegexpCharacterClass` 2.14.0 ------ diff --git a/rubocop.yml b/rubocop.yml index 4153d9c..0497c21 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -174,10 +174,8 @@ Style/ExponentialNotation: Style/SlicingWithRange: Enabled: true -# Re-enable this when the following is resolved: -# https://github.com/rubocop-hq/rubocop/issues/8098 Style/RedundantRegexpCharacterClass: - Enabled: false + Enabled: true Style/RedundantRegexpEscape: Enabled: true From 9c64d940ed6974b7c62fc383df9758dc852b33e9 Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 8 Jul 2020 14:54:22 +0100 Subject: [PATCH 3/6] Enable Style/RedundantFetchBlock --- CHANGELOG.md | 1 + rubocop.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f28022e..c3c4306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Changelog 2.15.0 ------ +* Support new cop introduced by rubocop v0.86: `Style/RedundantFetchBlock` * Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape` and `Style/RedundantRegexpCharacterClass` diff --git a/rubocop.yml b/rubocop.yml index 0497c21..a7b3ecb 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -180,5 +180,8 @@ Style/RedundantRegexpCharacterClass: Style/RedundantRegexpEscape: Enabled: true +Style/RedundantFetchBlock: + Enabled: true + Lint/DeprecatedOpenSSLConstant: Enabled: true From 96f657f237d4f2bef0e3e73c894d983291dfb73b Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 8 Jul 2020 14:56:06 +0100 Subject: [PATCH 4/6] Add support for cops introduced by 0.87 --- CHANGELOG.md | 2 ++ rubocop.yml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3c4306..671989b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Changelog 2.15.0 ------ +* Support new cop introduced by rubocop v0.87: `Style/AccessorGrouping`, `Style/BisectedAttrAccessor` + and `Style/RedundantAssignment` * Support new cop introduced by rubocop v0.86: `Style/RedundantFetchBlock` * Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape` and `Style/RedundantRegexpCharacterClass` diff --git a/rubocop.yml b/rubocop.yml index a7b3ecb..d8153aa 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -183,5 +183,14 @@ Style/RedundantRegexpEscape: Style/RedundantFetchBlock: Enabled: true +Style/AccessorGrouping: + Enabled: true + +Style/BisectedAttrAccessor: + Enabled: true + +Style/RedundantAssignment: + Enabled: true + Lint/DeprecatedOpenSSLConstant: Enabled: true From c9300ac41204fc1f2b1636156ea144b32176ff5e Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 8 Jul 2020 15:14:42 +0100 Subject: [PATCH 5/6] Require rubocop 0.87 --- gc_ruboconfig.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc_ruboconfig.gemspec b/gc_ruboconfig.gemspec index 4b253e5..88ec093 100644 --- a/gc_ruboconfig.gemspec +++ b/gc_ruboconfig.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.files = 'rubocop.yml' - spec.add_dependency 'rubocop', '>= 0.85' + spec.add_dependency 'rubocop', '>= 0.87' spec.add_dependency 'rubocop-rspec', '>= 1.38.1' spec.add_dependency 'rubocop-performance', '~> 1.5' end From 08f6d0228048f187a14c987b6467144f931e05be Mon Sep 17 00:00:00 2001 From: Ivan Giuliani Date: Wed, 8 Jul 2020 15:29:52 +0100 Subject: [PATCH 6/6] Disable Style/AccessorGrouping by default --- CHANGELOG.md | 4 ++-- rubocop.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 671989b..e6e72e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,8 @@ Changelog 2.15.0 ------ -* Support new cop introduced by rubocop v0.87: `Style/AccessorGrouping`, `Style/BisectedAttrAccessor` - and `Style/RedundantAssignment` +* Support new cop introduced by rubocop v0.87: `Style/AccessorGrouping` (disabled by default), + `Style/BisectedAttrAccessor` and `Style/RedundantAssignment` * Support new cop introduced by rubocop v0.86: `Style/RedundantFetchBlock` * Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape` and `Style/RedundantRegexpCharacterClass` diff --git a/rubocop.yml b/rubocop.yml index d8153aa..290bdd7 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -184,7 +184,7 @@ Style/RedundantFetchBlock: Enabled: true Style/AccessorGrouping: - Enabled: true + Enabled: false Style/BisectedAttrAccessor: Enabled: true