-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Incosistency between else_if_without_else
and needless_else
#11662
Comments
I personally disagree. They deal with the opposite pattern rather, and one is (in my experience) more idiomatic than the other. The same sort of argument can be made for |
Yeah having both of these warn by default would create a cycle where we repeatedly ask the user to add an |
Looks like this is a desired undocumented behaviour, or is there any? For those interested in consistency, |
There are several pairs of lints that suggest opposites to each other, but the only case where they should be in the same category is if that category is |
Document conflicting lints Documents the outcome described in #11662 so that the situation can be avoided in the future by other individuals. changelog: none
else_if_without_else
is allowed inrestriction
whileneedless_else
warns instyle
although both deal with the same pattern. It is then probably a good move to put both in the same category.The text was updated successfully, but these errors were encountered: