Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style/MethodDefParentheses removes parentheses around triple-dot delegation operator #9975

Closed
afn opened this issue Aug 3, 2021 · 0 comments · Fixed by #9976
Closed

Style/MethodDefParentheses removes parentheses around triple-dot delegation operator #9975

afn opened this issue Aug 3, 2021 · 0 comments · Fixed by #9976
Assignees
Labels

Comments

@afn
Copy link

afn commented Aug 3, 2021

When Style/MethodDefParentheses is configured with EnforcedStyle: require_no_parentheses, it removes parentheses around the ... method delegation operator, which leads to a syntax error.

test.rb:

def foo(...)
  bar(...)
end

.rubycop.yml:

Style/MethodDefParentheses:
  EnforcedStyle: require_no_parentheses

Expected behavior

No offenses detected.

Actual behavior

Offenses:

test.rb:1:8: C: [Correctable] Style/MethodDefParentheses: Use def without parentheses.
def foo(...)
       ^^^^^

Steps to reproduce the problem

See above

RuboCop version

1.18.4 (using Parser 3.0.2.0, rubocop-ast 1.8.0, running on ruby 3.0.1 x86_64-linux)
@dvandersluis dvandersluis self-assigned this Aug 3, 2021
dvandersluis added a commit to dvandersluis/rubocop that referenced this issue Aug 3, 2021
dvandersluis added a commit that referenced this issue Aug 3, 2021
[Fix #9975] Parentheses are always required for `Style/MethodDefParentheses` when a forwarding argument (`...`) is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants