-
-
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
Style/EmptyElse probably doesn't distinguish between actual nil and empty block #1611
Comments
That's correct. This is intentional, see #1444. On the other hand, I can understand if some prefer to be explicit about returning |
I'm fine with having it be configurable (the other setting would complain On 27 January 2015 at 22:09, Victor Koronen [email protected]
|
Totally agree with explicit nil being better. That communicates to the reader that else clause was not just forgotten. Returning implicit nil when falling through case statement is hard to understand being intentional. Other than that, great tool! I especially love all the auto-correct stuff. |
Btw, there's one more case to consider - a missing |
That's precisely what I meant. My convention is to even add comment
in such cases, to indicate that this not just something that is unhandled, but returning nil in purpose. There are probably better solutions, though. |
So, it seems to me this cop should support 3 styles:
|
+1, should satisfy both the followers of "be explicit" and "meh I know what I'm doing" schools :) |
[Fix #1611] Add SupportedStyles to EmptyElse cop
The text was updated successfully, but these errors were encountered: