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

Allow parentheses in single-line inheritance #8346

Merged

Conversation

gsamokovarov
Copy link
Contributor

@gsamokovarov gsamokovarov commented Jul 15, 2020

class Point < Struct.new(:x, :y); end was getting auto-corrected to
class Point < Struct.new :x, :y; end which is invalid Ruby code. Allow
the parentheses in this case for the following configurations:

Style/MethodCallWithArgsParentheses:
  EnforcedStyle: omit_parentheses

@gsamokovarov gsamokovarov force-pushed the allow-parens-in-single-line-inheritance branch 4 times, most recently from 5ea14fc to 7f97cac Compare July 16, 2020 07:34
CHANGELOG.md Outdated Show resolved Hide resolved
@gsamokovarov gsamokovarov force-pushed the allow-parens-in-single-line-inheritance branch from 7f97cac to efe6c16 Compare July 16, 2020 07:57
`class Point < Struct.new(:x, :y); end` was getting auto-corrected to
`class Point < Struct.new :x, :y; end` which is invalid Ruby code. Allow
the parentheses in this case for the following configurations:

```ruby
Style/MethodCallWithArgsParentheses:
  EnforcedStyle: omit_parentheses
```
@gsamokovarov gsamokovarov force-pushed the allow-parens-in-single-line-inheritance branch from efe6c16 to 150e306 Compare July 16, 2020 08:04
@gsamokovarov
Copy link
Contributor Author

Thanks for the review, @koic, can you check the changes now?

Copy link
Member

@koic koic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks good to me. Thank you!

@koic koic merged commit 2d3f95c into rubocop:master Jul 16, 2020
@gsamokovarov gsamokovarov deleted the allow-parens-in-single-line-inheritance branch July 16, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants