Skip to content

Commit e5a63a1

Browse files
committed
Autocorrect Rubocop offenses
1 parent e45fcc8 commit e5a63a1

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

.rubocop.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AllCops:
55
- vendor/**/*
66
- example/**/*
77
NewCops: enable
8-
TargetRubyVersion: 3.2
8+
TargetRubyVersion: 3.0
99
SuggestExtensions: false
1010

1111
# Layout stuff
@@ -74,6 +74,7 @@ Naming:
7474

7575
# Style stuff
7676
#
77+
7778
Style/Documentation:
7879
Enabled: false
7980

lib/grape_entity/condition/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module Grape
44
class Entity
55
module Condition
66
class Base
7-
def self.new(inverse, *args, &block)
8-
super(inverse).tap { |e| e.setup(*args, &block) }
7+
def self.new(inverse, ...)
8+
super(inverse).tap { |e| e.setup(...) }
99
end
1010

1111
def initialize(inverse = false)

lib/grape_entity/entity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@ def self.merge_options(options)
598598
if existing_val.is_a?(Hash) && new_val.is_a?(Hash)
599599
existing_val.merge(new_val)
600600
elsif new_val.is_a?(Hash)
601-
(opts["#{key}_extras".to_sym] ||= []) << existing_val
601+
(opts[:"#{key}_extras"] ||= []) << existing_val
602602
new_val
603603
else
604-
(opts["#{key}_extras".to_sym] ||= []) << new_val
604+
(opts[:"#{key}_extras"] ||= []) << new_val
605605
existing_val
606606
end
607607
else

lib/grape_entity/exposure/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module Exposure
99
class Base
1010
attr_reader :attribute, :is_safe, :documentation, :override, :conditions, :for_merge
1111

12-
def self.new(attribute, options, conditions, *args, &block)
13-
super(attribute, options, conditions).tap { |e| e.setup(*args, &block) }
12+
def self.new(attribute, options, conditions, ...)
13+
super(attribute, options, conditions).tap { |e| e.setup(...) }
1414
end
1515

1616
def initialize(attribute, options, conditions)

spec/grape_entity/entity_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030

3131
it 'makes sure that :format_with as a proc cannot be used with a block' do
3232
# rubocop:disable Style/BlockDelimiters
33-
# rubocop:disable Lint/Debugger
34-
expect { subject.expose :name, format_with: proc {} do p 'hi' end }.to raise_error ArgumentError
35-
# rubocop:enable Lint/Debugger
33+
expect {
34+
subject.expose :name, format_with: proc {} do
35+
p 'hi'
36+
end
37+
}.to raise_error ArgumentError
3638
# rubocop:enable Style/BlockDelimiters
3739
end
3840

0 commit comments

Comments
 (0)