-
Notifications
You must be signed in to change notification settings - Fork 39
New Rule: Block not captured #158
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
Comments
Basically, we would like to report if there is a |
Hmm, this should be already covered by |
And I hope eventually by |
@veelenga For some reason it doesn't seem to work though 🤔 |
That's strange. It is covered by specs: ameba/spec/ameba/rule/lint/unused_argument_spec.cr Lines 118 to 133 in be65ba2
But you are right, it doesn't work on the example in the description. |
@veelenga I know, I was trying to understand wtf is goin' on there, but to no avail yet. |
@Sija it ignores defs by default. There is a configuration property:
That was done because of this discussion (which makes sense) #52 (comment) The rule still has to be tuned in order to properly support the example below: def m(&)
yield
end currently it reports an issue:
|
Maybe it makes more sense to correct |
Anonymous block annotations are present since a bit of time now. Adding
&
shows that the method yields a block, but using&block
either means that or that the block is captured.Here is a simple example:
The text was updated successfully, but these errors were encountered: