From 19c0a940470cc2adf973b3631d7e43d6b00d4887 Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Fri, 4 Feb 2022 11:36:00 -0500 Subject: [PATCH 1/4] Upgrade to rubocop 1.x --- bixby.gemspec | 9 ++++----- bixby_default.yml | 4 ++-- bixby_rspec_enabled.yml | 6 ++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/bixby.gemspec b/bixby.gemspec index 40a80d8..ab52d6a 100644 --- a/bixby.gemspec +++ b/bixby.gemspec @@ -15,11 +15,10 @@ Gem::Specification.new do |spec| spec.version = '3.0.2' spec.license = 'Apache-2.0' - spec.add_dependency 'rubocop', '0.85.1' - # Added to prevent downstream breakage; When we update the above - # Rubocop version, we will want to revisit this dependency. Either - # changing the version range OR removing it. - spec.add_dependency 'rubocop-ast', '~> 0.3.0' + spec.required_ruby_version = '>= 2.5.0' + + spec.add_dependency 'rubocop', '>= 1', '< 2' + spec.add_dependency 'rubocop-ast' spec.add_dependency 'rubocop-performance' spec.add_dependency 'rubocop-rails' spec.add_dependency 'rubocop-rspec' diff --git a/bixby_default.yml b/bixby_default.yml index 0372596..3dcd15c 100644 --- a/bixby_default.yml +++ b/bixby_default.yml @@ -162,7 +162,7 @@ Style/MethodCallWithoutArgsParentheses: Style/MethodDefParentheses: Enabled: true -Style/MethodMissingSuper: +Style/MissingSuper: Enabled: true Style/MissingRespondToMissing: @@ -795,7 +795,7 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: true -Lint/UselessComparison: +Lint/BinaryOperatorWithIdenticalOperands: Enabled: true Lint/UselessElseWithoutRescue: diff --git a/bixby_rspec_enabled.yml b/bixby_rspec_enabled.yml index f11489f..e82d851 100644 --- a/bixby_rspec_enabled.yml +++ b/bixby_rspec_enabled.yml @@ -1,9 +1,8 @@ --- require: rubocop-rspec -AllCops: - RSpec: - Patterns: +RSpec: + Include: - _spec.rb - "(?:^|/)spec/" @@ -25,7 +24,6 @@ RSpec/DescribeMethod: RSpec/EmptyExampleGroup: Enabled: true - CustomIncludeMethods: [] RSpec/ExampleLength: Enabled: true From 6bed6974f9df80d6aa02b6d7573d5feb8bc4df1b Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Fri, 4 Feb 2022 11:45:54 -0500 Subject: [PATCH 2/4] Update CircleCI config and bump required ruby to match versions tested (and not EOL as well) --- .circleci/config.yml | 26 +++++++++----------------- bixby.gemspec | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53bc6a3..7fd09d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - samvera: samvera/circleci-orb@0 + samvera: samvera/circleci-orb@1 jobs: bundle_lint_test: @@ -12,7 +12,7 @@ jobs: type: string bundler_version: type: string - default: 1.17.3 + default: 2.3.6 executor: name: 'samvera/ruby' @@ -21,11 +21,9 @@ jobs: steps: - samvera/cached_checkout - - samvera/bundle_for_gem: + - samvera/bundle: ruby_version: << parameters.ruby_version >> bundler_version: << parameters.bundler_version >> - project: << parameters.project >> - cache_version: '2' - samvera/rubocop @@ -33,23 +31,17 @@ workflows: version: 2 ci: jobs: - - bundle_lint_test: - project: bixby - name: ruby2-4 - ruby_version: 2.4.10 - - - bundle_lint_test: - project: bixby - name: ruby2-5 - ruby_version: 2.5.8 - - bundle_lint_test: project: bixby name: ruby2-6 - ruby_version: 2.6.6 + ruby_version: 2.6.9 - bundle_lint_test: project: bixby name: ruby2-7 - ruby_version: 2.7.1 + ruby_version: 2.7.5 + - bundle_lint_test: + project: bixby + name: ruby3-0 + ruby_version: 3.0.3 diff --git a/bixby.gemspec b/bixby.gemspec index ab52d6a..ed92a70 100644 --- a/bixby.gemspec +++ b/bixby.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.version = '3.0.2' spec.license = 'Apache-2.0' - spec.required_ruby_version = '>= 2.5.0' + spec.required_ruby_version = '>= 2.6' spec.add_dependency 'rubocop', '>= 1', '< 2' spec.add_dependency 'rubocop-ast' From e9e10653f0395bf2d50c118dcbfe70f80610ed16 Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Fri, 4 Feb 2022 11:58:13 -0500 Subject: [PATCH 3/4] Ensure CircleCI uses the bixby defaults for rubocop --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..3141bab --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: bixby_default.yml From 38f480930123e8612e8b19a2942d987d904d0509 Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Fri, 11 Feb 2022 10:53:19 -0500 Subject: [PATCH 4/4] Fix namespace of MissingSuper cop --- bixby_default.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bixby_default.yml b/bixby_default.yml index 3dcd15c..80a2a06 100644 --- a/bixby_default.yml +++ b/bixby_default.yml @@ -162,9 +162,6 @@ Style/MethodCallWithoutArgsParentheses: Style/MethodDefParentheses: Enabled: true -Style/MissingSuper: - Enabled: true - Style/MissingRespondToMissing: Enabled: true @@ -726,6 +723,9 @@ Lint/LiteralInInterpolation: Lint/Loop: Enabled: true +Lint/MissingSuper: + Enabled: true + Lint/MultipleComparison: Enabled: true