-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
On this input (which was already tweaked by RuboCop):
def parens(**kwargs, &)
surround('(', ')', **kwargs, &)
end
auto-correct drops the arguments.
Expected behavior
def parens(...)
surround('(', ')', ...)
end
Actual behavior
def parens(...)
surround(...)
end
Steps to reproduce the problem
$ cat rubocop.rb
def parens(**kwargs, &)
surround('(', ')', **kwargs, &)
end
$ bundle exec rubocop -x --only Style/ArgumentsForwarding rubocop.rb
Inspecting 1 file
C
Offenses:
rubocop.rb:1:12: C: [Corrected] Style/ArgumentsForwarding: Use shorthand syntax ... for arguments forwarding.
def parens(**kwargs, &)
^^^^^^^^^^^
rubocop.rb:2:12: C: [Corrected] Style/ArgumentsForwarding: Use shorthand syntax ... for arguments forwarding.
surround('(', ')', **kwargs, &)
^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 2 offenses detected, 2 offenses corrected
$ cat rubocop.rb
def parens(...)
surround(...)
end
RuboCop version
$ bundle exec rubocop -V
1.65.1 (using Parser 3.3.4.2, rubocop-ast 1.32.0, running on ruby 3.3.4) [arm64-darwin23]
- rubocop-performance 1.21.1
I have:
AllCops:
TargetRubyVersion: "3.1"
but nothing specified for Style/ArgumentsForwarding.