-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to deal with counter-argument to rules? Concrete example PLC1901 #14602
Comments
There has been complaints regarding PLC1901 in particular before: #4282 (comment) |
Oh, I just found #5264 Is this rule still in "nursery"? Is PLC1901 meant to only be active if explicitly opt-in? I seem to get it just by having select "PL". Nothing in the rule page documentation hints about this. |
Hi @kaddkaka Thanks for all the research and linking the relevant issues. That's useful. Yes, the |
@MichaReiser thanks, I agree this is the way to go. In the closed PR it was mentioned that this rule was moved to a "nursery". Does that corresponds to the rules enabled by |
Yes, preview replaced the nursery concept and it is to opt-in to more experimental Ruff features and PLC1901 is one such experimental rule |
Would it be valuable to have more rule categories here?
So instead of:
|
Yes, we think that's the long term solution for this. We plan to recategorize rules but haven't gotten around to actually do it. See #1774 |
The pylint rule PLC1901 (
compare-to-empty-string
) checks for comparison with empty string which it considers "unnecessary", but I would argue this is not a problem, but rather the reverse!Example code from documentation:
Even if the compared object is known to be a string or not,
x == ""
shows and explain the intent much better thannot x
.not x
does not give any clue on what type x is supposed to be.Could there be a section "Why is this not bad" in the documentation?
The text was updated successfully, but these errors were encountered: