-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix crash when a variable annotation is used as if test expression
#10714
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
base: main
Are you sure you want to change the base?
Conversation
|
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 9b67845 |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10714 +/- ##
=======================================
Coverage 95.97% 95.97%
=======================================
Files 176 176
Lines 19537 19539 +2
=======================================
+ Hits 18750 18752 +2
Misses 787 787
π New features to boost your workflow:
|
consider-using-assignment-expr when a variable annotation without assignment is used as the if test expressionif test expression
if test expressionif test expression
if test expressionif test expression
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.
Just a question, LGTM otherwise.
| # Should ignore variable annotation without assignment | ||
| if prev_sibling.value is None: | ||
| return |
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.
Should it be directly in _check_prev_sibling_to_if_stmt ?
Type of Changes
Description
The
consider-using-assignment-exprcheck should ignore cases where a variable annotation statement is represented as anAnnAssignnode without an assigned value.Closes #10707