Skip to content

Fix false negative for nonlocal-without-binding. #7099

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 3 commits into from
Jul 6, 2022

Conversation

mbyrnepr2
Copy link
Member

@mbyrnepr2 mbyrnepr2 commented Jun 30, 2022

It was not emitted when the nonlocal name is assigned later on in the same scope.

Closes #6883

Type of Changes

Type
βœ“ πŸ› Bug fix

mbyrnepr2 and others added 2 commits June 30, 2022 15:37
It was not emitted when the `nonlocal` name is assigned later on in the same scope.

Closes pylint-dev#6883
@Pierre-Sassoulas Pierre-Sassoulas added False Negative πŸ¦‹ No message is emitted but something is wrong with the code C: used-before-assignment Issues related to 'used-before-assignment' check labels Jun 30, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.0 milestone Jun 30, 2022
@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review June 30, 2022 14:12
@github-actions

This comment has been minimized.

@coveralls
Copy link

coveralls commented Jun 30, 2022

Pull Request Test Coverage Report for Build 2622111493

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

Files with Coverage Reduction New Missed Lines %
pylint/checkers/refactoring/refactoring_checker.py 14 98.19%
pylint/checkers/variables.py 14 97.4%
Totals Coverage Status
Change from base Build 2589893265: 0.0008%
Covered Lines: 16705
Relevant Lines: 17518

πŸ’› - Coveralls

@mbyrnepr2
Copy link
Member Author

πŸ‘‹

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.

Sorry!

If you're up for it I would appreciate if we could add the confidence level to this message as well. But no worries if you don't have the time to do that right now!

@DanielNoord
Copy link
Collaborator

This could go into a patch release by the way. Seeing as you are the original poster: do you need this bug fix soon or can you wait until 2.15?

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.

LGTM, thank you !

@Pierre-Sassoulas
Copy link
Member

This could go into a patch release by the way

I think it's a false negative and we only put false positive in patch release or we can get a vicious circle where the issues increase with a new patch instead of decreasing πŸ˜„

@DanielNoord
Copy link
Collaborator

This could go into a patch release by the way

I think it's a false negative and we only put false positive in patch release or we can get a vicious circle where the issues increase with a new patch instead of decreasing πŸ˜„

Ah, my bad. Never mind!

@mbyrnepr2
Copy link
Member Author

mbyrnepr2 commented Jul 6, 2022

Sorry!

If you're up for it I would appreciate if we could add the confidence level to this message as well. But no worries if you don't have the time to do that right now!

I've added HIGH; is that the right one?

And no worries by the way - I am in no rush; I thought it might have gone under the radar with all the issues you maintainers look at every day.

@Pierre-Sassoulas
Copy link
Member

It look like there's no inference or control flow involved so I'd say yes. (Maybe some control flow ?)

@DanielNoord
Copy link
Collaborator

I double checked. There is no control flow (it's a very basic check) so this is indeed correct!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

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

This comment was generated for commit b720f3c

@DanielNoord DanielNoord merged commit 852e25c into pylint-dev:main Jul 6, 2022
@mbyrnepr2 mbyrnepr2 deleted the 6883_false_negative_nonlocal branch July 6, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: used-before-assignment Issues related to 'used-before-assignment' check False Negative πŸ¦‹ No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False negative | No binding for nonlocal found
4 participants