Skip to content

Commit c3ab82f

Browse files
authored
Update RuboCop to 1.81.7 and fix style offenses (#2625)
1 parent 4f67e5f commit c3ab82f

File tree

14 files changed

+25
-20
lines changed

14 files changed

+25
-20
lines changed

.rubocop_todo.yml

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

73+
# Offense count: 1
74+
RSpec/LeakyLocalVariable:
75+
Exclude:
76+
- 'spec/grape/api_spec.rb'
77+
7378
# Offense count: 1
7479
RSpec/MessageChain:
7580
Exclude:
@@ -94,48 +99,39 @@ RSpec/RepeatedExample:
9499
- 'spec/grape/middleware/versioner/accept_version_header_spec.rb'
95100
- 'spec/grape/validations/validators/allow_blank_validator_spec.rb'
96101

97-
# Offense count: 10
102+
# Offense count: 8
98103
RSpec/RepeatedExampleGroupDescription:
99104
Exclude:
100105
- 'spec/grape/api_spec.rb'
101106
- 'spec/grape/endpoint_spec.rb'
102107
- 'spec/grape/util/inheritable_setting_spec.rb'
103-
- 'spec/grape/validations/validators/values_validator_spec.rb'
104108

105-
# Offense count: 4
109+
# Offense count: 2
106110
RSpec/StubbedMock:
107111
Exclude:
108112
- 'spec/grape/dsl/inside_route_spec.rb'
109-
- 'spec/grape/dsl/routing_spec.rb'
110113
- 'spec/grape/middleware/formatter_spec.rb'
111114

112-
# Offense count: 118
115+
# Offense count: 32
113116
RSpec/SubjectStub:
114117
Exclude:
115118
- 'spec/grape/api_spec.rb'
116-
- 'spec/grape/dsl/callbacks_spec.rb'
117-
- 'spec/grape/dsl/helpers_spec.rb'
118119
- 'spec/grape/dsl/inside_route_spec.rb'
119-
- 'spec/grape/dsl/middleware_spec.rb'
120120
- 'spec/grape/dsl/parameters_spec.rb'
121-
- 'spec/grape/dsl/request_response_spec.rb'
122121
- 'spec/grape/dsl/routing_spec.rb'
123-
- 'spec/grape/dsl/settings_spec.rb'
124122
- 'spec/grape/middleware/base_spec.rb'
125123
- 'spec/grape/middleware/formatter_spec.rb'
126124
- 'spec/grape/middleware/globals_spec.rb'
127125
- 'spec/grape/middleware/stack_spec.rb'
128126

129-
# Offense count: 22
127+
# Offense count: 20
130128
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
131129
RSpec/VerifiedDoubles:
132130
Exclude:
133131
- 'spec/grape/api_spec.rb'
134132
- 'spec/grape/dsl/inside_route_spec.rb'
135133
- 'spec/grape/integration/rack_sendfile_spec.rb'
136134
- 'spec/grape/middleware/formatter_spec.rb'
137-
- 'spec/grape/validations/multiple_attributes_iterator_spec.rb'
138-
- 'spec/grape/validations/single_attribute_iterator_spec.rb'
139135

140136
# Offense count: 2
141137
RSpec/VoidExpect:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#### Features
44

5+
* [#2625](https://github.com/ruby-grape/grape/pull/2625): Update rubocop to 1.81.7 and fix style offenses - [@ericproulx](https://github.com/ericproulx).
56
* Your contribution here.
67

78
#### Fixes

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ group :development, :test do
88
gem 'builder', require: false
99
gem 'bundler'
1010
gem 'rake'
11-
gem 'rubocop', '1.76.2', require: false
12-
gem 'rubocop-performance', '1.25.0', require: false
13-
gem 'rubocop-rspec', '3.6.0', require: false
11+
gem 'rubocop', '1.81.7', require: false
12+
gem 'rubocop-performance', '1.26.1', require: false
13+
gem 'rubocop-rspec', '3.8.0', require: false
1414
end
1515

1616
group :development do

lib/grape/api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def self.build(val)
1919

2020
class << self
2121
extend Forwardable
22+
2223
attr_accessor :base_instance, :instances
2324

2425
delegate_missing_to :base_instance

lib/grape/api/instance.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Instance
2020

2121
class << self
2222
extend Forwardable
23+
2324
attr_reader :instance, :base
2425
attr_accessor :configuration
2526

lib/grape/middleware/stack.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Middleware
66
# It allows to insert and insert after
77
class Stack
88
extend Forwardable
9+
910
class Middleware
1011
attr_reader :args, :block, :klass
1112

lib/grape/util/cache.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Cache
99

1010
class << self
1111
extend Forwardable
12+
1213
def_delegators :cache, :[]
1314
def_delegators :instance, :cache
1415
end

spec/grape/api/deeply_included_options_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
let(:default) do
3333
Module.new do
3434
extend ActiveSupport::Concern
35+
3536
included do
3637
format :json
3738
end

spec/grape/api/nested_helpers_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
let(:helper_methods) do
55
Module.new do
66
extend Grape::API::Helpers
7+
78
def current_user
89
@current_user ||= params[:current_user]
910
end

spec/grape/api_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,6 +3909,7 @@ def my_method
39093909
v1 = Class.new(described_class) do
39103910
version :v1, using: :path
39113911
include module_to_include
3912+
39123913
my_method
39133914
end
39143915
v2 = Class.new(described_class) do

0 commit comments

Comments
 (0)