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
24 changes: 10 additions & 14 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 2025-06-18 20:27:19 UTC using RuboCop version 1.76.2.
# on 2025-11-15 17:39:14 UTC using RuboCop version 1.81.7.
# 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 @@ -70,6 +70,11 @@ RSpec/InstanceVariable:
- 'spec/grape/middleware/versioner/accept_version_header_spec.rb'
- 'spec/grape/middleware/versioner/header_spec.rb'

# Offense count: 1
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/grape/api_spec.rb'

# Offense count: 1
RSpec/MessageChain:
Exclude:
Expand All @@ -94,48 +99,39 @@ RSpec/RepeatedExample:
- 'spec/grape/middleware/versioner/accept_version_header_spec.rb'
- 'spec/grape/validations/validators/allow_blank_validator_spec.rb'

# Offense count: 10
# Offense count: 8
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/grape/api_spec.rb'
- 'spec/grape/endpoint_spec.rb'
- 'spec/grape/util/inheritable_setting_spec.rb'
- 'spec/grape/validations/validators/values_validator_spec.rb'

# Offense count: 4
# Offense count: 2
RSpec/StubbedMock:
Exclude:
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/dsl/routing_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'

# Offense count: 118
# Offense count: 32
RSpec/SubjectStub:
Exclude:
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/callbacks_spec.rb'
- 'spec/grape/dsl/helpers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/dsl/middleware_spec.rb'
- 'spec/grape/dsl/parameters_spec.rb'
- 'spec/grape/dsl/request_response_spec.rb'
- 'spec/grape/dsl/routing_spec.rb'
- 'spec/grape/dsl/settings_spec.rb'
- 'spec/grape/middleware/base_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
- 'spec/grape/middleware/globals_spec.rb'
- 'spec/grape/middleware/stack_spec.rb'

# Offense count: 22
# Offense count: 20
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/integration/rack_sendfile_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
- 'spec/grape/validations/multiple_attributes_iterator_spec.rb'
- 'spec/grape/validations/single_attribute_iterator_spec.rb'

# Offense count: 2
RSpec/VoidExpect:
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

* [#2625](https://github.com/ruby-grape/grape/pull/2625): Update rubocop to 1.81.7 and fix style offenses - [@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 @@ -8,9 +8,9 @@ group :development, :test do
gem 'builder', require: false
gem 'bundler'
gem 'rake'
gem 'rubocop', '1.76.2', require: false
gem 'rubocop-performance', '1.25.0', require: false
gem 'rubocop-rspec', '3.6.0', require: false
gem 'rubocop', '1.81.7', require: false
gem 'rubocop-performance', '1.26.1', require: false
gem 'rubocop-rspec', '3.8.0', require: false
end

group :development do
Expand Down
1 change: 1 addition & 0 deletions lib/grape/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def self.build(val)

class << self
extend Forwardable

attr_accessor :base_instance, :instances

delegate_missing_to :base_instance
Expand Down
1 change: 1 addition & 0 deletions lib/grape/api/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Instance

class << self
extend Forwardable

attr_reader :instance, :base
attr_accessor :configuration

Expand Down
1 change: 1 addition & 0 deletions lib/grape/middleware/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Middleware
# It allows to insert and insert after
class Stack
extend Forwardable

class Middleware
attr_reader :args, :block, :klass

Expand Down
1 change: 1 addition & 0 deletions lib/grape/util/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Cache

class << self
extend Forwardable

def_delegators :cache, :[]
def_delegators :instance, :cache
end
Expand Down
1 change: 1 addition & 0 deletions spec/grape/api/deeply_included_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
let(:default) do
Module.new do
extend ActiveSupport::Concern

included do
format :json
end
Expand Down
1 change: 1 addition & 0 deletions spec/grape/api/nested_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
let(:helper_methods) do
Module.new do
extend Grape::API::Helpers

def current_user
@current_user ||= params[:current_user]
end
Expand Down
1 change: 1 addition & 0 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3909,6 +3909,7 @@ def my_method
v1 = Class.new(described_class) do
version :v1, using: :path
include module_to_include

my_method
end
v2 = Class.new(described_class) do
Expand Down
1 change: 1 addition & 0 deletions spec/grape/dsl/parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let(:dummy_class) do
Class.new do
include Grape::DSL::Parameters

attr_accessor :api, :element, :parent

def initialize
Expand Down
1 change: 1 addition & 0 deletions spec/grape/validations/params_documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
let(:klass) do
Class.new do
include Grape::Validations::ParamsDocumentation

attr_accessor :api

def initialize(api)
Expand Down
4 changes: 1 addition & 3 deletions spec/grape/validations/params_scope_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,7 @@ def initialize(value)
a_options = [{}, { values: %w[x y z] }]
b_options = [{}, { type: String }, { allow_blank: false }, { type: String, allow_blank: false }]
combinations = a_decls.product(a_options, b_options)
combinations.each_with_index do |combination, i|
a_decl, a_opts, b_opts = combination

combinations.each_with_index do |(a_decl, a_opts, b_opts), i|
context "(case #{i})" do
before do
# puts "a_decl: #{a_decl}, a_opts: #{a_opts}, b_opts: #{b_opts}"
Expand Down
1 change: 1 addition & 0 deletions spec/grape/validations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,7 @@ def validate_param!(attr_name, params)
before do
shared_params = Module.new do
extend Grape::DSL::Helpers::BaseHelper

params :period do
optional :start_date
optional :end_date
Expand Down