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

[pyupgrade] Do not offer fix when at least one target is global/nonlocal (UP028) #16451

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Mar 1, 2025

Summary

Resolves #16445.

UP028 is now no longer always fixable: it will not offer a fix when at least one ExprName target is bound to either a global or a nonlocal declaration.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Mar 1, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added the bug Something isn't working label Mar 3, 2025
@MichaReiser MichaReiser merged commit a3ae76e into astral-sh:main Mar 4, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UP028 false positive when a target variable is global or nonlocal
2 participants