-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Parenthesize warning incorrectly identifying method as param #4198
Comments
Same mistake happens for common rspec assertions like:
Where parenthesize seems also not needed |
This example is different - it this DSL that's completely fine, but it might have also been an actual oversight. The cop can't possible tell those apart. I'm advising people to simply disable the cop when needed in such cases. Or we can add some method exceptions list. At any rate - that's a different problem. |
Thanks for quick answer, in my case I've decided to fix it refactoring to:
But you may consider putting exception I guess... this is looks like common case to me. |
As well rubocop raises only with |
…ator methods This cop would register an offense when the outer method is an operator, e.g.: ``` foo == bar { |b| b.baz } ``` However, this is idiomatic Ruby, and disambiguation isn't needed in these cases. This change fixes that.
@dzirtusss I'm seeing the exact same thing here, barks only on |
the cop identifies the method
sort_by
as a paramaterExpected behavior
Unknown what the purpose of the cop exactly is
Actual behavior
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: