From bde71b6624355eba3478e9c7e02e93b0ce2a416c Mon Sep 17 00:00:00 2001 From: Erim Icel Date: Mon, 27 Apr 2026 17:10:42 +0100 Subject: [PATCH] chore: bump rubocop to ~> 1.86 and rubocop-rspec to ~> 3.9 Bumps the linting toolchain: - rubocop: 1.72.2 (pinned exact) -> ~> 1.86 - rubocop-rspec: ~> 3.6 -> ~> 3.9 Loosens rubocop to a pessimistic constraint so it can pick up patch and minor bumps without another Gemfile change. The newer rubocop / rubocop-rspec set surfaces ten new offences. Nine of them are two cops misfiring on `spec/spec_helper.rb`, which is integration infrastructure (boots Typesense via docker-compose) rather than an example file: - `RSpec/Output` flags the `puts`/`print` calls that report docker-compose startup progress to the operator. They are not assertions on stdout, so the cop's intent does not apply. - `Naming/PredicateMethod` flags `ensure_typesense_running`, which returns a boolean but has heavy side effects (boots a docker container); renaming it to `ensure_typesense_running?` would be misleading. Both cops are excluded only for `spec/spec_helper.rb`. The tenth offence was a real but trivial `Style/HashAsLastArrayItem` / `Layout/SpaceInsideHashLiteralBraces` in `collection_spec.rb`, fixed by autocorrect. Verified: `bundle exec rubocop` reports 97 files, 0 offences. Full RSpec suite is unchanged at 151 / 1 / 27 (the single pre-existing `truncate_len` integration failure on master remains, unrelated). --- .rubocop.yml | 8 ++++++++ Gemfile | 4 ++-- spec/typesense/collection_spec.rb | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 64c0c3e..3b4da17 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -47,5 +47,13 @@ RSpec/ExampleLength: RSpec/MultipleExpectations: Enabled: false +RSpec/Output: + Exclude: + - spec/spec_helper.rb + +Naming/PredicateMethod: + Exclude: + - spec/spec_helper.rb + Style/HashSyntax: Enabled: false # We still want to support older versions of Ruby diff --git a/Gemfile b/Gemfile index b68e534..33be87a 100644 --- a/Gemfile +++ b/Gemfile @@ -15,8 +15,8 @@ gem 'rake', '~> 13.0' gem 'rspec', '~> 3.9' gem 'rspec_junit_formatter', '~> 0.4' gem 'rspec-legacy_formatters', '~> 1.0' # For codecov formatter -gem 'rubocop', '1.72.2' -gem 'rubocop-rspec', '~> 3.6', require: false +gem 'rubocop', '~> 1.86' +gem 'rubocop-rspec', '~> 3.9', require: false gem 'simplecov', '~> 0.18' gem 'timecop', '~> 0.9' gem 'webmock', '~> 3.8' diff --git a/spec/typesense/collection_spec.rb b/spec/typesense/collection_spec.rb index 373d23d..ed36ec5 100644 --- a/spec/typesense/collection_spec.rb +++ b/spec/typesense/collection_spec.rb @@ -52,7 +52,7 @@ it 'updates the specified collection' do update_schema = { 'fields' => [ - 'name' => 'field', 'drop' => true + { 'name' => 'field', 'drop' => true } ] } stub_request(:patch, Typesense::ApiCall.new(typesense.configuration).send(:uri_for, '/collections/companies', typesense.configuration.nodes[0]))