Skip to content
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 used-before-assignment false negative for nonlocals #10075

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

zenlyj
Copy link
Contributor

@zenlyj zenlyj commented Nov 9, 2024

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

A continuation of #10034. This PR addresses the case where a nonlocal declaration exists outside the immediate enclosing frame for both the usage and definition.

Changes primarily extend the check for nonlocal declarations so that it stops once it reaches the first enclosing frame, ensuring that it does not go beyond the initial enclosing frame.

Closes #10069

@zenlyj
Copy link
Contributor Author

zenlyj commented Nov 9, 2024

we should probably skip changelog for this one? as it is more of an internal update

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 95.80%. Comparing base (0687c85) to head (db56fc9).
Report is 62 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10075   +/-   ##
=======================================
  Coverage   95.80%   95.80%           
=======================================
  Files         174      174           
  Lines       18959    18962    +3     
=======================================
+ Hits        18163    18166    +3     
  Misses        796      796           
Files with missing lines Coverage Ξ”
pylint/checkers/variables.py 97.25% <100.00%> (+<0.01%) ⬆️

@zenlyj zenlyj force-pushed the fix/10069-nonlocal-uba branch from a7c28bd to f347162 Compare November 9, 2024 08:18

This comment has been minimized.

@zenlyj zenlyj force-pushed the fix/10069-nonlocal-uba branch from f347162 to db56fc9 Compare November 9, 2024 09:02
Copy link
Contributor

github-actions bot commented Nov 9, 2024

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

This comment was generated for commit db56fc9

@jacobtylerwalls jacobtylerwalls added the Skip news πŸ”‡ This change does not require a changelog entry label Nov 9, 2024
@jacobtylerwalls jacobtylerwalls added this to the 4.0.0 milestone Nov 9, 2024
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 !

@Pierre-Sassoulas Pierre-Sassoulas merged commit a18a27f into pylint-dev:main Nov 9, 2024
47 of 48 checks passed
@zenlyj zenlyj deleted the fix/10069-nonlocal-uba branch November 9, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip news πŸ”‡ This change does not require a changelog entry Unreleased
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[uba] Fix new false negative from #10034
3 participants