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

Cop idea: Using super with Arguments #12353

Closed
ydakuka opened this issue Nov 4, 2023 · 0 comments · Fixed by #12390
Closed

Cop idea: Using super with Arguments #12353

ydakuka opened this issue Nov 4, 2023 · 0 comments · Fixed by #12390

Comments

@ydakuka
Copy link

ydakuka commented Nov 4, 2023

Description

Always use parentheses when calling super with arguments

https://rubystyle.guide/#super-with-args

Describe the solution you'd like

# bad
super name, age

# good
super(name, age)
koic added a commit to koic/rubocop that referenced this issue Nov 20, 2023
Fixes rubocop#12353.

This PR adds new `Style/SuperWithArgsParentheses` cop

```ruby
# bad
super name, age

# good
super(name, age)
```

The cop is named `Style/SuperWithArgsParentheses`, contrasting with `Style/MethodCallWithArgsParentheses`.
Unlike `Style/MethodCallWithArgsParentheses`, which requires consideration for no-parentheses usage in DSL.
`super` is not used as a DSL, so it is enabled by default.

For these reasons, it has been made into a separate, new cop.
bbatsov pushed a commit that referenced this issue Nov 20, 2023
Fixes #12353.

This PR adds new `Style/SuperWithArgsParentheses` cop

```ruby
# bad
super name, age

# good
super(name, age)
```

The cop is named `Style/SuperWithArgsParentheses`, contrasting with `Style/MethodCallWithArgsParentheses`.
Unlike `Style/MethodCallWithArgsParentheses`, which requires consideration for no-parentheses usage in DSL.
`super` is not used as a DSL, so it is enabled by default.

For these reasons, it has been made into a separate, new cop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants