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

[perflint] Parenthesize walrus expressions in autofix for manual-list-comprehension (PERF401) #15050

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Dec 18, 2024

This PR ensures that, when transforming a for-loop into a comprehension for the rule manual-list-comprehension (PERF401), we parenthesize if-stmt tests when they are assignment expressions.

Closes #15047

@dylwil3 dylwil3 added bug Something isn't working documentation Improvements or additions to documentation fixes Related to suggested fixes for violations labels Dec 18, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dylwil3 dylwil3 merged commit 596d80c into astral-sh:main Dec 19, 2024
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 documentation Improvements or additions to documentation fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PERF401 is triggered on for-loops that has the walrus operator inside
3 participants