-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Skip check for chained comparisons for use-implicit-booleaness-not-x checks
#10246
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
Conversation
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10246 +/- ##
=======================================
Coverage 95.85% 95.86%
=======================================
Files 175 175
Lines 19056 19058 +2
=======================================
+ Hits 18267 18269 +2
Misses 789 789
π New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a changelog? Rest of the changes LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks great, the primer looks amazing (I realized that we had a bug in the message for some chained comparisons they were not displayed in full but now it's gone, so.. good)
|
π€ Effect of this PR on checked open source code: π€ Effect on django:
Effect on pandas:
Effect on sentry:
This comment was generated for commit 187e34f |
use-implicit-booleaness-not-comparison checksuse-implicit-booleaness-not-x checks
β¦ checks (#10246) (#10248) (cherry picked from commit 0a1044b) Co-authored-by: Zen Lee <[email protected]>
Type of Changes
Description
Currently, the
use-implicit-booleaness-not-comparisoncheck is applied to expressions with chained comparison. The emitted message and suggested code correction seem inaccurate, and I can't seem to find existing functional tests indicating that this behavior is intended. Therefore, these changes will skip the check when chained comparison nodes are visited.Take for example:
foo != bar == []is equivalent tofoo != bar and bar == [], which is not the same asnot foo.Similar for
use-implicit-booleaness-not-comparison-to-zeroanduse-implicit-booleaness-not-comparison-to-string.Closes #10065