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 gsamokovarov:allow-parens-in-single-line-inheritance branch 4 times, most recently from 5ea14fc to 7f97cac Jul 15, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
@gsamokovarov gsamokovarov force-pushed the gsamokovarov:allow-parens-in-single-line-inheritance branch from 7f97cac to efe6c16 Jul 16, 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:

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

@gsamokovarov gsamokovarov commented Jul 16, 2020

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

@koic
koic approved these changes Jul 16, 2020
Copy link
Member

@koic koic left a comment

Yeah, this looks good to me. Thank you!

@koic koic merged commit 2d3f95c into rubocop-hq:master Jul 16, 2020
26 checks passed
26 checks passed
windows 2.4
Details
windows 2.5
Details
windows 2.6
Details
windows 2.7
Details
windows mingw
Details
ci/circleci: cc-setup Your tests passed on CircleCI!
Details
ci/circleci: cc-upload-coverage Your tests passed on CircleCI!
Details
ci/circleci: documentation-checks Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-rubocop Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-spec Your tests passed on CircleCI!
Details
@gsamokovarov gsamokovarov deleted the gsamokovarov:allow-parens-in-single-line-inheritance branch Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.