-
-
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
[FIX #4189] Lint/AmbiguousBlockAssociation cites unambiguous lambda p… #4237
[FIX #4189] Lint/AmbiguousBlockAssociation cites unambiguous lambda p… #4237
Conversation
One more thing... For the following code
Is it expected behavior? |
@ivanovaleksey yes, i think that's expected behavior because we call method |
@ivanovaleksey It's expected behavior that cop adds offense, but I'm not sure about error message though. |
Yes, that is the case.
Does it mean to write |
@ivanovaleksey I've just checked your example and it returns the following message:
Which is good. It means that your should add parentheses for |
This needs a changelog entry. |
@smakagon actually it should be This way it doesn't produce offense. |
@ivanovaleksey: This cop is meaningless to run on RSpec files, because the DSL deliberately uses the constructs this cop is checking for. 🙂 |
@Drenmi thanks, I see. |
6729cac
to
1a8ce30
Compare
@bbatsov updated changelog. Thanks. |
1a8ce30
to
237510e
Compare
I updated my gem to 0.48.1 but I'm still having the same warning for my scope: |
@shayani me too |
The problem is present in |
I want to add something for clarification. @ivanovaleksey wrote:
Yes, that what RuboCop wants you to write. It assumes that passing a block and not an empty hash is what you wanted. The fact that |
Fixes problem reported in #4189.
With this fix the following code is ok for
AmbiguousBlockAssociation
cop:scope :technical, -> { where(technical: true) }
Now
AmbiguousBlockAssociation
cop treats lambda properly.