Skip to content

Fixed false positive for global-variable-not-assigned #5656

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

Conversation

mbyrnepr2
Copy link
Member

@mbyrnepr2 mbyrnepr2 commented Jan 10, 2022

Fixed false positive for global-variable-not-assigned when the del statement is used.
If the del statement is used on the variable (in the same scope on a later line-number) then the warning is not emitted.

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

Closes #5333

@coveralls
Copy link

coveralls commented Jan 10, 2022

Pull Request Test Coverage Report for Build 1677460756

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0008%) to 93.705%

Totals Coverage Status
Change from base Build 1663696938: 0.0008%
Covered Lines: 14365
Relevant Lines: 15330

💛 - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 Control flow Requires control flow understanding labels Jan 10, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.14.0 milestone Jan 10, 2022
@mbyrnepr2 mbyrnepr2 force-pushed the 5333_false_positive_w0602 branch from b034219 to d4f04a7 Compare January 10, 2022 12:58
@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review January 10, 2022 13:23
Copy link
Collaborator

@DanielNoord DanielNoord 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 This seems small enough to fit in 2.13.

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.14.0, 2.13.0 Jan 10, 2022
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.

Thank you @mbyrnepr2, very straightforward and easy to merge fix :)

@Pierre-Sassoulas Pierre-Sassoulas merged commit 3ad42a0 into pylint-dev:main Jan 10, 2022
@mbyrnepr2 mbyrnepr2 deleted the 5333_false_positive_w0602 branch January 11, 2022 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Control flow Requires control flow understanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive for W0602 when using del
4 participants