Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[pyupgrade] Handle end-of-line comments for quoted-annotation (UP037) #15824

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jan 30, 2025

This PR uses the tokens of the parsed annotation available in the Checker, instead of re-lexing (using SimpleTokenizer) the annotation. This avoids some limitations of the SimpleTokenizer, such as not being able to handle number and string literals.

Closes #15816 .

@dylwil3 dylwil3 added bug Something isn't working fixes Related to suggested fixes for violations labels Jan 30, 2025
Copy link
Contributor

github-actions bot commented Jan 30, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dylwil3 dylwil3 merged commit 56f956a into astral-sh:main Jan 30, 2025
21 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UP037 fix crashes when a terminal comment follows a literal
2 participants