From 728d8f2b61715ce523acd39f8a84b2af9c97ec8f Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:27:47 -0400 Subject: [PATCH 1/6] Add rubocop-rspec_rails gem From v2.28, rubocop-rspec split out Rails-specific rules into a new gem, rubocop-rspec_rails whose initial version number matches rubocop-rspec. This commit adds the new gem to this project's gemspec. --- rubocop-cargosense.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rubocop-cargosense.gemspec b/rubocop-cargosense.gemspec index 798fd91..ea8d2d4 100644 --- a/rubocop-cargosense.gemspec +++ b/rubocop-cargosense.gemspec @@ -31,5 +31,6 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "rubocop-performance", "~> 1.20" spec.add_runtime_dependency "rubocop-rails", "~> 2.23" spec.add_runtime_dependency "rubocop-rake", "~> 0.6" - spec.add_runtime_dependency "rubocop-rspec", "~> 2.26" + spec.add_runtime_dependency "rubocop-rspec", "~> 2.28" + spec.add_runtime_dependency "rubocop-rspec_rails", "~> 2.28" end From bfe34a58f573aab9295cbbeeb62dcbe9f87d02bd Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:28:23 -0400 Subject: [PATCH 2/6] Add rubocop-rspec_rails config file Adds the config file that requires the plugin and that's about it. --- config/default.yml | 1 + config/rubocop-rspec_rails.yml | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 config/rubocop-rspec_rails.yml diff --git a/config/default.yml b/config/default.yml index ed8adbe..aba0168 100644 --- a/config/default.yml +++ b/config/default.yml @@ -6,6 +6,7 @@ inherit_from: - ./rubocop-rails.yml - ./rubocop-rake.yml - ./rubocop-rspec.yml + - ./rubocop-rspec_rails.yml inherit_mode: merge: diff --git a/config/rubocop-rspec_rails.yml b/config/rubocop-rspec_rails.yml new file mode 100644 index 0000000..bdaea4e --- /dev/null +++ b/config/rubocop-rspec_rails.yml @@ -0,0 +1,8 @@ +# Code style checking for RSpec Rails files. A plugin for the RuboCop code style +# enforcing & linting tool. +# +# @see https://rubygems.org/gems/rubocop-rspec_rails +# @see https://docs.rubocop.org/rubocop-rspec_rails +# @see https://github.com/rubocop/rubocop-rspec_rails + +require: rubocop-rspec_rails From 70056858f89dcc37750ceefafe8cf7508d8675a5 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:28:39 -0400 Subject: [PATCH 3/6] Update Gemfile.lock Re-ran `bundle install` for development dependencies. --- Gemfile.lock | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cd7a8f5..d16b549 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,8 @@ PATH rubocop-performance (~> 1.20) rubocop-rails (~> 2.23) rubocop-rake (~> 0.6) - rubocop-rspec (~> 2.26) + rubocop-rspec (~> 2.28) + rubocop-rspec_rails (~> 2.28) GEM remote: https://rubygems.org/ @@ -74,10 +75,13 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.27.1) + rubocop-rspec (2.29.1) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.3) + rubocop (~> 1.40) ruby-progressbar (1.13.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) From c97f1660ff8dbcbf9eacd6162c50fc0f9c5fd555 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:29:36 -0400 Subject: [PATCH 4/6] Bump version to 1.0.0 The previous commits set a new minimum version for rubocop-rspec to account for the splitting off of the rubocop-rspec_rails gem. I think that raises to the level of a breaking change, so we go major version here. --- rubocop-cargosense.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-cargosense.gemspec b/rubocop-cargosense.gemspec index ea8d2d4..7a6acbc 100644 --- a/rubocop-cargosense.gemspec +++ b/rubocop-cargosense.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 3.0" spec.name = "rubocop-cargosense" - spec.version = "0.2.0" + spec.version = "1.0.0" spec.authors = ["CargoSense"] spec.email = ["rubygems@cargosense.com"] From cda2ff6c4720e0fb3922e7001a0b2e8212239f17 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:30:36 -0400 Subject: [PATCH 5/6] Update Gemfile.lock Re-ran `bundle install` to catch the version number change. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d16b549..4c09ed3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rubocop-cargosense (0.2.0) + rubocop-cargosense (1.0.0) rubocop (~> 1.59) rubocop-capybara (~> 2.20) rubocop-factory_bot (~> 2.25) From abc2899962aee2b848ab79ddc24b432a75f00621 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 11 Apr 2024 13:46:54 -0400 Subject: [PATCH 6/6] Update minimum rubocop-rspec_rails version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seems v2.28.0 required rubocop-rspec as a dependency which… will create circular dependencies if your project specifies both rubocop-rspec and rubocop-rspec_rails. This [should be resolved by v2.28.1](https://github.com/rubocop/rubocop-rspec_rails/blob/master/CHANGELOG.md#2281-2024-03-29). --- Gemfile.lock | 2 +- rubocop-cargosense.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4c09ed3..d3d6382 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ PATH rubocop-rails (~> 2.23) rubocop-rake (~> 0.6) rubocop-rspec (~> 2.28) - rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (~> 2.28.1) GEM remote: https://rubygems.org/ diff --git a/rubocop-cargosense.gemspec b/rubocop-cargosense.gemspec index 7a6acbc..764efad 100644 --- a/rubocop-cargosense.gemspec +++ b/rubocop-cargosense.gemspec @@ -32,5 +32,5 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "rubocop-rails", "~> 2.23" spec.add_runtime_dependency "rubocop-rake", "~> 0.6" spec.add_runtime_dependency "rubocop-rspec", "~> 2.28" - spec.add_runtime_dependency "rubocop-rspec_rails", "~> 2.28" + spec.add_runtime_dependency "rubocop-rspec_rails", "~> 2.28.1" end