`Style/ArgumentsForwarding` enforce anonymous bad autocorrect
janklimo opened this issue · comments
Jan Klimo commented
The following code:
def validators_on(*args)
[
super,
resource_class.validators_on(*args),
*@auxiliary_resource_classes.map do |klass|
klass.validators_on(*args)
end,
].flatten
end
end
results in invalid autocorrect output with
Style/ArgumentsForwarding:
UseAnonymousForwarding: true
Enabled: true
Expected behavior
def validators_on(*args)
[
super,
resource_class.validators_on(*args),
*@auxiliary_resource_classes.map do |klass|
klass.validators_on(*args)
end,
].flatten
end
end
Actual behavior
def validators_on(*)
[
super,
resource_class.validators_on(*),
*@auxiliary_resource_classes.map do |klass|
klass.validators_on(*args)
end,
].flatten
end
end
*args
will no longer be defined.
Steps to reproduce the problem
Example code above.
RuboCop version
1.63.4 (using Parser 3.3.1.0, rubocop-ast 1.31.2, running on ruby 3.3.1) [arm64-darwin23]
- rubocop-capybara 2.20.0
- rubocop-factory_bot 2.25.1
- rubocop-performance 1.20.2
- rubocop-rails 2.24.0
- rubocop-rspec 2.27.1