From 882ede21cc99cd603161d35ad098dde5c14d0b91 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 surfaced ten new offences. Nine of them were two cops misfiring on `spec/spec_helper.rb`, which is integration infrastructure rather than an example file: - `RSpec/Output` flagged 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` flagged `ensure_typesense_running`, which returns a boolean but has heavy side effects (boots a docker container); renaming to `ensure_typesense_running?` would be misleading. Both cops are excluded only for `spec/spec_helper.rb`, with comments explaining why. 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). Co-Authored-By: Claude Opus 4.7 (1M context) --- .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..63b4a32 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -47,5 +47,13 @@ RSpec/ExampleLength: RSpec/MultipleExpectations: Enabled: false +RSpec/Output: + Exclude: + - spec/spec_helper.rb # Boots Typesense via docker-compose; the puts/print calls report startup progress to the operator, not to assertions. + +Naming/PredicateMethod: + Exclude: + - spec/spec_helper.rb # ensure_typesense_running returns whether the helper started Typesense, but has heavy side effects, so a `?` suffix would be misleading. + 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]))