You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Style/ArgumentsForwarding cop should not trigger on this method, because replaceing bar: nil, **opts will a) include :bar in the arguments to foo_without_bar b) remove the definition of the local bar variable.
Actual behavior
The following is included in the rubocop output:
foo.rb:6:9: C: [Correctable] Style/ArgumentsForwarding: Use shorthand syntax ... for arguments forwarding.
def foo(bar: nil, **opts, &blk)
^^^^^^^^^^^^^^^^^^^^^^
foo.rb:7:19: C: [Correctable] Style/ArgumentsForwarding: Use shorthand syntax ... for arguments forwarding.
foo_without_bar(**opts, &blk)
^^^^^^^^^^^^
Steps to reproduce the problem
Run rubocop 1.56.1 on this file:
# frozen_string_literal: true
alias foo_without_bar foo
def foo(bar: nil, **opts, &blk)
foo_without_bar(**opts, &blk)
do_something_with(bar) unless bar.nil?
end
Given a method with a keyword argument and kwargs:
Expected behavior
The
Style/ArgumentsForwarding
cop should not trigger on this method, because replaceingbar: nil, **opts
will a) include:bar
in the arguments tofoo_without_bar
b) remove the definition of the localbar
variable.Actual behavior
The following is included in the
rubocop
output:Steps to reproduce the problem
Run rubocop 1.56.1 on this file:
RuboCop version
The text was updated successfully, but these errors were encountered: