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

Extend Style/MethodCallParentheses to police method calls with arguments #3737

Closed
Drenmi opened this issue Nov 23, 2016 · 0 comments
Closed

Comments

@Drenmi
Copy link
Collaborator

Drenmi commented Nov 23, 2016

So far, this cop just checks that we're not using redundant parentheses for method calls without arguments. We should extend this to allow enforcing parentheses for method calls with arguments.

This would need to exclude method calls made from within a constant body (e.g. attr_reader) and common "keyword" methods (e.g. puts), and potentially be configurable to always omit parentheses. (The last part is a bit harder, since sometimes that produces ambiguous code.)

Example:

foo :bar, :baz

should generate an offense and be corrected to:

foo(:bar, :baz)
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

No branches or pull requests

1 participant