Skip to content

Commit 430a45d

Browse files
authored
Update rubocop and its dependencies (#2532)
* Update rubocop and its dependencies Apply fixes * Add CHANGELOG.md
1 parent c8f8737 commit 430a45d

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

.rubocop_todo.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-10-06 16:00:59 UTC using RuboCop version 1.66.1.
3+
# on 2025-02-08 13:42:40 UTC using RuboCop version 1.71.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -60,7 +60,7 @@ RSpec/IndexedLet:
6060
- 'spec/grape/presenters/presenter_spec.rb'
6161
- 'spec/shared/versioning_examples.rb'
6262

63-
# Offense count: 38
63+
# Offense count: 39
6464
# Configuration parameters: AssignmentOnly.
6565
RSpec/InstanceVariable:
6666
Exclude:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#### Features
44

5+
* [#2532](https://github.com/ruby-grape/grape/pull/2532): Update RuboCop 1.71.2 - [@ericproulx](https://github.com/ericproulx).
56
* Your contribution here.
67

78
#### Fixes

Gemfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ group :development, :test do
1010
gem 'builder', require: false
1111
gem 'bundler'
1212
gem 'rake'
13-
gem 'rubocop', '1.66.1', require: false
14-
gem 'rubocop-performance', '1.21.1', require: false
15-
gem 'rubocop-rspec', '3.0.5', require: false
13+
gem 'rubocop', '1.71.2', require: false
14+
gem 'rubocop-performance', '1.23.1', require: false
15+
gem 'rubocop-rspec', '3.4.0', require: false
1616
end
1717

1818
group :development do

lib/grape/cookies.rb

-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ def each(&block)
3434
end
3535

3636
# see https://github.com/rack/rack/blob/main/lib/rack/utils.rb#L338-L340
37-
# rubocop:disable Layout/SpaceBeforeBrackets
3837
def delete(name, **opts)
3938
options = opts.merge(max_age: '0', value: '', expires: Time.at(0))
4039
self.[]=(name, options)
4140
end
42-
# rubocop:enable Layout/SpaceBeforeBrackets
4341
end
4442
end

lib/grape/dsl/helpers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def api_changed(new_api)
9898
protected
9999

100100
def process_named_params
101-
return unless instance_variable_defined?(:@named_params) && @named_params && @named_params.any?
101+
return if @named_params.blank?
102102

103103
api.namespace_stackable(:named_params, @named_params)
104104
end

lib/grape/dsl/inside_route.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def handle_passed_param(params_nested_path, has_passed_children = false, &_block
107107

108108
if type == 'Hash' && !has_children
109109
{}
110-
elsif type == 'Array' || (type&.start_with?('[') && type&.exclude?(','))
110+
elsif type == 'Array' || (type&.start_with?('[') && type.exclude?(','))
111111
[]
112112
elsif type == 'Set' || type&.start_with?('#<Set')
113113
Set.new
@@ -447,7 +447,7 @@ def entity_class_for_obj(object, options)
447447
def entity_representation_for(entity_class, object, options)
448448
embeds = { env: env }
449449
embeds[:version] = env[Grape::Env::API_VERSION] if env.key?(Grape::Env::API_VERSION)
450-
entity_class.represent(object, **embeds.merge(options))
450+
entity_class.represent(object, **embeds, **options)
451451
end
452452

453453
def http_version

0 commit comments

Comments
 (0)