Skip to content

Conversation

LaBatata101
Copy link
Contributor

@LaBatata101 LaBatata101 commented Jun 19, 2025

Summary

Fix remove_argument to handle parenthesized arguments properly. Previously, it would not delete the entire parenthesized argument, leaving the close parenthesis. This caused the autofix of some rules to introduce a syntax error, like in the case of #18798.

I had to update the function signature to include the CommentRanges, that's why there are some many files changed.

Fixes #18798

Test Plan

Add regression test

@LaBatata101 LaBatata101 requested a review from AlexWaygood as a code owner June 19, 2025 21:51
Copy link
Contributor

github-actions bot commented Jun 19, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood AlexWaygood added bug Something isn't working fixes Related to suggested fixes for violations labels Jun 20, 2025
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.

Thanks!

@LaBatata101 LaBatata101 requested a review from AlexWaygood June 20, 2025 15:12
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.

Thanks!

@AlexWaygood AlexWaygood enabled auto-merge (squash) June 20, 2025 21:22
@AlexWaygood AlexWaygood merged commit d926628 into astral-sh:main Jun 20, 2025
33 checks passed
dcreager added a commit that referenced this pull request Jun 20, 2025
* main:
  Handle parenthesized arguments in `remove_argument` (#18805)
  Unify helpers modules (#18835)
  Normalize some docs sections (#18831)
  [`flake8_pyi`] Fix `PYI041`'s fix causing TypeError with `None | None | ...` (#18637)
@LaBatata101 LaBatata101 deleted the fix-RUF056 branch June 22, 2025 13:46
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.

RUF056 fix introduces a syntax error for a parenthesized value
2 participants