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

MethodCallParentheses lacks exception for empty blocks #589

Closed
agrimm opened this issue Oct 27, 2013 · 1 comment
Closed

MethodCallParentheses lacks exception for empty blocks #589

agrimm opened this issue Oct 27, 2013 · 1 comment

Comments

@agrimm
Copy link
Contributor

agrimm commented Oct 27, 2013

The following code

def foo
  5.times.map() {}
end

would fall foul of the MethodCallParentheses cop.

Unlike #585 , removing the parentheses would not affect Ruby's ability to parse the code, but if parentheses were removed, programmers may be confused as to whether the {} represents a hash, or a block.

So far, I don't have any good use case scenarios as to why someone should write such code, so I don't know if it's worth fixing, but I wanted to let you know.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2013

I, too, cannot think of any scenario in which one would be willing to write code like this, so I'll probably leave the code as-is.

@agrimm agrimm closed this as completed Nov 5, 2013
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

2 participants