A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rubocop/rubocop/issues/14390 below:

Auto-correction of Style/ArgumentsForwarding removes required parameters · Issue #14390 · rubocop/rubocop · GitHub

I have this code:

def render(component, *, **, &)
  if component.is_a?(Middleman::ViewComponents::Components::Base)
    component.render_in(self, *, **, &)
  else
    super
  end
end

I let rubocop auto-correct it.

Expected behavior

It should be auto-corrected to:

def render(component, ...)
  if component.is_a?(Middleman::ViewComponents::Components::Base)
    component.render_in(self, ...)
  else
    super
  end
end
Actual behavior

Instead, the additional parameter self is removed. (component is kept)

def render(component, ...)
  if component.is_a?(Middleman::ViewComponents::Components::Base)
    component.render_in(...) # <== self is gone
  else
    super
  end
end
RuboCop version
1.79.0 (using Parser 3.3.9.0, Prism 1.4.0, rubocop-ast 1.46.0, analyzing as Ruby 3.4, running on ruby 3.4.5) [x64-mingw-ucrt]
  - rubocop-performance 1.25.0
  - rubocop-rake 0.7.1

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4