-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
Missing test for EmptyElseBlock rule #4206
Comments
There wasn't a test for
The test passes. Has this been resolved in the month since this was posted? In any case, it'd be good to have a spec file for |
Whoops. How embarrassing... the rule indeed exists and is enabled. If you wouldn't mind opening a PR with your test, that would be great. I was reviewing some other code and saw "else" wasn't handled in the EmptyIfBlock rule, not realising there was a separate rule to check the |
else
blocks
Well, it might be necessary to put that original tag back on the ticket, as this fails:
Is this correct, or is it desired behavior for the |
Probably a matter of opinion. Strictly speaking there's no else block there, so there's no need for this rule to flag it (since it doesn't exist). I'm personally ok with that behaviour, though your example should probably be picked up by a rule somewhere, just not sure if that should be this rule or a new one. |
Just to confirm that this issue is NOT urgent for 1.19.1, the only behavior change in the related PR is |
Expected Behavior of the rule
The empty
else
block is reported in tests:Context
EmptyIfBlock
is only reporting emptythen
blocks, not emptyelse
blocks.There is no test for EmptyElseBlock rule.
The text was updated successfully, but these errors were encountered: