Skip to content

Files

Latest commit

 

History

History
33 lines (22 loc) · 557 Bytes

Style-ArgumentsForwarding.md

File metadata and controls

33 lines (22 loc) · 557 Bytes

Pattern: Missing use of arguments forwarding

Issue: -

Description

In Ruby 2.7, arguments forwarding has been added.

This cop identifies places where do_something(*args, &block) can be replaced by do_something(…​).

Examples

# bad
def foo(*args, &block)
  bar(*args, &block)
end

# bad
def foo(*args, **kwargs, &block)
  bar(*args, **kwargs, &block)
end

# good
def foo(...)
  bar(...)
end

Further Reading