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 safe navigation calls for Style/MethodCallWithArgsParentheses #9612

Closed

Conversation

gsamokovarov
Copy link
Contributor

While calls like foo&.[] bar do compile, I won't blame people if they
want to leave the parentheses so they know what's going on, even if
they chose to use EnforcedStyle: omit_parentheses.

I'm proposing we legitimize the parens in foo&.[](bar) and any other
safe navigation calls. I don't think this deserves extra configuration
either.

What do you folks think?

…rgsParentheses`

While calls like `foo&.[] bar` 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 in `foo&.[](bar)` and any other
safe navigation calls. I don't think this deserves extra configuration
either.
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 17, 2021

It seems to me this has little to do with safe navigation and more to do with operator method names, as doing something.[] bar is pretty much the same.

@gsamokovarov
Copy link
Contributor Author

This makes sense, will open another PR with a change that allows parens for operator methods.

@gsamokovarov
Copy link
Contributor Author

👉 #9620

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