Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-10-06 16:00:59 UTC using RuboCop version 1.66.1.
# on 2025-02-08 13:42:40 UTC using RuboCop version 1.71.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -60,7 +60,7 @@ RSpec/IndexedLet:
- 'spec/grape/presenters/presenter_spec.rb'
- 'spec/shared/versioning_examples.rb'

# Offense count: 38
# Offense count: 39
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#### Features

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

#### Fixes
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ group :development, :test do
gem 'builder', require: false
gem 'bundler'
gem 'rake'
gem 'rubocop', '1.66.1', require: false
gem 'rubocop-performance', '1.21.1', require: false
gem 'rubocop-rspec', '3.0.5', require: false
gem 'rubocop', '1.71.2', require: false
gem 'rubocop-performance', '1.23.1', require: false
gem 'rubocop-rspec', '3.4.0', require: false
end

group :development do
Expand Down
2 changes: 0 additions & 2 deletions lib/grape/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ def each(&block)
end

# see https://github.com/rack/rack/blob/main/lib/rack/utils.rb#L338-L340
# rubocop:disable Layout/SpaceBeforeBrackets
def delete(name, **opts)
options = opts.merge(max_age: '0', value: '', expires: Time.at(0))
self.[]=(name, options)
end
# rubocop:enable Layout/SpaceBeforeBrackets
end
end
2 changes: 1 addition & 1 deletion lib/grape/dsl/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def api_changed(new_api)
protected

def process_named_params
return unless instance_variable_defined?(:@named_params) && @named_params && @named_params.any?
return if @named_params.blank?

api.namespace_stackable(:named_params, @named_params)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/grape/dsl/inside_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def handle_passed_param(params_nested_path, has_passed_children = false, &_block

if type == 'Hash' && !has_children
{}
elsif type == 'Array' || (type&.start_with?('[') && type&.exclude?(','))
elsif type == 'Array' || (type&.start_with?('[') && type.exclude?(','))
[]
elsif type == 'Set' || type&.start_with?('#<Set')
Set.new
Expand Down Expand Up @@ -447,7 +447,7 @@ def entity_class_for_obj(object, options)
def entity_representation_for(entity_class, object, options)
embeds = { env: env }
embeds[:version] = env[Grape::Env::API_VERSION] if env.key?(Grape::Env::API_VERSION)
entity_class.represent(object, **embeds.merge(options))
entity_class.represent(object, **embeds, **options)
end

def http_version
Expand Down