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 #9684] Support IgnoredMethods
option for Lint/AmbiguousBlockAssociation
#9685
[Fix #9684] Support IgnoredMethods
option for Lint/AmbiguousBlockAssociation
#9685
Conversation
6e171a6
to
6b12444
Compare
Two points from me:
I was also under the impression that the built-in Ruby warning has discouraged this particular style of using RSpec and it's not as common as it used to be. I will consider the suggested change once the PR is ready, but I'm not making any promises that it will be merged. |
6b12444
to
94d0122
Compare
…sBlockAssociation`
94d0122
to
7e838aa
Compare
Thanks for your comments, @bbatsov I understand your point regarding Lint cops, but the intention for this configuration is exactly to enable support for such specific DSL, when you have absolute knowledge of the ambiguity risks. In the issue I mentioned the change RSpec matcher, but the same offenses are also reported when using the satisfy matcher. Currently, the only alternative left is to disable the cop entirely for (e.g.) all RSpec files. I don't think an Allowed rule would work better here, since this is a very general Lint cop. What do you think about a stricter configuration? |
I don't get this part - "AllowedMethods" and "IgnoredMethods" mean exactly the same. It's just a different way of phrasing this. |
class AmbiguousBlockAssociation < Base | ||
include IgnoredMethods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I had forgotten the mixing was named like this. You can escape from legacy. :D
I'd be down with this, as it's going to yield less false negatives, but it will add extra verbosity. It's hard to say how much of an impact it'd have in practice. |
No one had anything else to add, so it seems we can merge this. Thanks! |
This PR adds support for
IgnoredMethods
parameter inLint/AmbiguousBlockAssociation
cop to allow better DSL support.It fixes #9684 and is also related with #7486.