-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix false positive for unused-import
when disabling both used-before-assignment
and undefined-variable
#6096
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
Fix false positive for unused-import
when disabling both used-before-assignment
and undefined-variable
#6096
Conversation
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.
Great analysis. I think this condition and the instance variables it manages should just be deleted. Does it make sense to do it in a follow up PR or here?
If the check is moved even lower to leapfrog over the last CONTINUE
action, then it's not accomplishing much. (Even _is_only_type_annotation()
is good about short-circuiting.)
Pull Request Test Coverage Report for Build 2085456668
💛 - Coveralls |
|
@Pierre-Sassoulas how do you handle backports? |
TLDR we squash on the main branch so we only have to cherry-pick one commit on the maintenance branch later. (What is not said is that I cherry-pick everything in chronological order just before the release, so you can just label "Need backport", We could do it just after merging too)
Yes, in the current patch version 2.13.5 for the changelog and the whatsnew for 2.13. |
…efore-assignment`` and ``undefined-variable``
Thanks for the info! I have updated the |
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.
I think it should be a rebase instead of a merge, it's probably fixable with git rebase origin/main
.
…efore-assignment`` and ``undefined-variable``
…efore-assignment`` and ``undefined-variable``
…efore-assignment`` and ``undefined-variable``
You need to disregard what git is telling you when you're pushing and actually rewrite the history by using |
002cbca
to
26c47d1
Compare
Thanks a ton, that did the trick. I'm still struggling with |
Co-authored-by: Jacob Walls <[email protected]>
Thanks @jacobtylerwalls, removed the entries for 2.14. |
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.
👍
…efore-assignment`` and ``undefined-variable`` (#6096) Co-authored-by: Jacob Walls <[email protected]>
doc/whatsnew/<current release.rst>
.and preferred name in
script/.contributors_aliases.json
Type of Changes
Description
This should fix the false positive reported in #6089 (yes I named my branch wrong 😉).
But as I am not very familar with this part of the code base, I would like to ask @jacobtylerwalls for a review if moving this check can have other side effects than just a small performance loss.
Test suite is passing locally.
Closes #6089