We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AllowComments
Style/EmptyElse
As discussed with @paracycle and @Morriar.
By default RuboCop will not allow an empty else, or an else with only a nil.
else
nil
But in some cases, having an empty else clause can help communicate the intent, even if the else isn't returning anything.
https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EmptyElse
The text was updated successfully, but these errors were encountered:
if foo bar else nil end
Isn't idiomatic Ruby. In ruby empty elses aren't necessary
Sorry, something went wrong.
After second thought, let's do it.
Successfully merging a pull request may close this issue.
As discussed with @paracycle and @Morriar.
By default RuboCop will not allow an empty
else
, or an else with only anil
.But in some cases, having an empty
else
clause can help communicate the intent, even if theelse
isn't returning anything.https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EmptyElse
The text was updated successfully, but these errors were encountered: