-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add new Lint/EmptyBlock
cop
#8895
Conversation
90eb936
to
38908ad
Compare
I'm guessing an empty one-line block with a comment after it would fine as well. E.g.
|
This will conflict with Style/InlineComment How about preceding comment then? # no-op
x = ->{} |
That cop is (thankfully) disabled by default. In any case, inline comment should be supported. |
38908ad
to
59764c3
Compare
Added support for inline comments. |
59764c3
to
58c74cc
Compare
Great work! |
This cop checks for blocks without a body.
Blocks without a body most of the time indicate useless code (left after refactoring, for example) or that some explanation about its emptiness should be given (using a comment).