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 operator method calls for Style/MethodCallWithArgsParentheses #9620

Merged

Conversation

@gsamokovarov
Copy link
Contributor

@gsamokovarov gsamokovarov commented Mar 19, 2021

While calls like data&.[] value, value.=== other do compile, I won't
blame people if they want to leave the parentheses so they know what's
going on.

I'm proposing we legitimize the parens when calling operator methods. I
don't think this deserves extra configuration.

@gsamokovarov gsamokovarov force-pushed the gsamokovarov:omit-parentheses-operator-methods branch 2 times, most recently from 463ec79 to c05503e Mar 20, 2021
@bbatsov
Copy link
Collaborator

@bbatsov bbatsov commented Mar 22, 2021

The change is fine, but it should be reflected in the cop documentation via some examples, otherwise I don't think the users will figure out how this works. And you have to move that changelog entry. :-)

…rgsParentheses`

While calls like `data&.[] value`, `value.=== other` do compile, I won't
blame people if they want to leave the parentheses so they know what's
going on.

I'm proposing we legitimize the parens when calling operator methods.  I
don't think this deserves extra configuration.
@gsamokovarov gsamokovarov force-pushed the gsamokovarov:omit-parentheses-operator-methods branch from c05503e to 2e6fec1 Mar 22, 2021
@bbatsov bbatsov merged commit 0ec3ee3 into rubocop:master Mar 22, 2021
30 of 31 checks passed
30 of 31 checks passed
@github-actions
windows 2.4
Details
@github-actions
windows 2.5
Details
@github-actions
windows 2.6
Details
@github-actions
windows 2.7
Details
@github-actions
windows 3.0
Details
@github-actions
windows mingw
Details
ci/circleci: ruby-2.6-ascii_spec Your tests failed on CircleCI
Details
@mergify
Summary 2 potential rules
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-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-3.0-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-3.0-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-3.0-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
@bbatsov
Copy link
Collaborator

@bbatsov bbatsov commented Mar 22, 2021

Thanks!

@gsamokovarov gsamokovarov deleted the gsamokovarov:omit-parentheses-operator-methods branch Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants