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

[flake8-comprehensions] Parenthesize sorted when needed for unnecessary-call-around-sorted (C413) #15825

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jan 30, 2025

If there is any ParenthesizedWhitespace (in the sense of LibCST) after the function name sorted and before the arguments, then we must wrap sorted with parentheses after removing the surrounding function.

Closes #15789

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

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dylwil3 dylwil3 merged commit 13cf3e6 into astral-sh:main Jan 30, 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 fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C413 fix is wrong when a newline appears between sorted and the opening parenthesis
2 participants