Skip to content

Fix FP for used-before-assignment when reimporting name used in type annotation #8095

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

Merged
merged 2 commits into from
Jan 23, 2023

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Closes #7882

@codecov
Copy link

codecov bot commented Jan 22, 2023

Codecov Report

Merging #8095 (0ccf733) into main (8885a57) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8095   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files         176      176           
  Lines       18542    18542           
=======================================
  Hits        17701    17701           
  Misses        841      841           
Impacted Files Coverage Ξ”
pylint/checkers/variables.py 97.38% <ΓΈ> (ΓΈ)

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘Œ

@Pierre-Sassoulas Pierre-Sassoulas added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Jan 22, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Jan 22, 2023
@github-actions

This comment has been minimized.

Copy link
Contributor

@clavedeluna clavedeluna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add the issue's exact example as a test case?

Co-authored-by: Mark Byrne <[email protected]>
@jacobtylerwalls
Copy link
Member Author

Would it make sense to add the issue's exact example as a test case?

Open to different views here. I generally think that if we can fold it into the existing cases, it reduces bloat. I verified that this change fails before the fix. But I also understand the viewpoint that original cases should be added (as long as sufficiently small).

@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 0ccf733

@Pierre-Sassoulas Pierre-Sassoulas merged commit 99ee841 into pylint-dev:main Jan 23, 2023
@jacobtylerwalls jacobtylerwalls deleted the issue-7882 branch January 23, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive from used-before-assignment when variable is reimported
4 participants