diff --git a/.rubocop.yml b/.rubocop.yml index 432e84f55..78c6b010d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,9 +7,11 @@ AllCops: - bin/**/* require: - - rubocop-performance - rubocop-rspec +plugins: + - rubocop-performance + inherit_from: .rubocop_todo.yml Layout/LineLength: diff --git a/CHANGELOG.md b/CHANGELOG.md index 46efc359b..bdddf2878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * [#2557](https://github.com/ruby-grape/grape/pull/2557): Add `lint!` - [@ericproulx](https://github.com/ericproulx). * [#2561](https://github.com/ruby-grape/grape/pull/2561): Optimize hash alloc for middleware's default options - [@ericproulx](https://github.com/ericproulx). * [#2563](https://github.com/ruby-grape/grape/pull/2563): Update `Grape::Middleware::Auth::Base` - [@ericproulx](https://github.com/ericproulx). +* [#2571](https://github.com/ruby-grape/grape/pull/2571): Update RuboCop 1.75.8 - [@pieterocp](https://github.com/pieterocp). * Your contribution here. #### Fixes diff --git a/Gemfile b/Gemfile index ae3753cd9..6b3afac54 100644 --- a/Gemfile +++ b/Gemfile @@ -10,8 +10,8 @@ group :development, :test do gem 'builder', require: false gem 'bundler' gem 'rake' - gem 'rubocop', '1.71.2', require: false - gem 'rubocop-performance', '1.23.1', require: false + gem 'rubocop', '1.75.8', require: false + gem 'rubocop-performance', '1.25.0', require: false gem 'rubocop-rspec', '3.4.0', require: false end diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index b2fa81e75..2720ccc89 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -1422,7 +1422,7 @@ def to_txt def initialize(app, *args) @args = args @app = app - @block = block_given? ? true : nil + @block = block_given? || nil end def call(env) @@ -4536,8 +4536,8 @@ def inherited(api) let(:shared_api_module) do Module.new do - # rubocop:disable Style/ExplicitBlockArgument because this causes - # the underlying issue in this form + # rubocop:disable Style/ExplicitBlockArgument -- because + # this causes the underlying issue in this form def uniqe_id_route params do use :unique_id diff --git a/spec/support/integer_helpers.rb b/spec/support/integer_helpers.rb index 670cb52a6..5de732ddf 100644 --- a/spec/support/integer_helpers.rb +++ b/spec/support/integer_helpers.rb @@ -3,7 +3,7 @@ module Spec module Support module Helpers - INTEGER_CLASS_NAME = 0.to_i.class.to_s.freeze + INTEGER_CLASS_NAME = 0.class.to_s.freeze def integer_class_name INTEGER_CLASS_NAME