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

[ruff] - extend comment deletions for unused-noqa (RUF100) #13105

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

diceroll123
Copy link
Contributor

Summary

Extends deletions for RUF100, deleting trailing text from noqa directives, while preserving upcoming comments on the same line if any.

In cases where it deletes a comment up to another comment on the same line, the whitespace between them is now shown to be in the autofix in the diagnostic as well. Leading whitespace before the removed comment is not, though.

Fixes #12251

Test Plan

cargo test

Copy link
Contributor

github-actions bot commented Aug 26, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dhruvmanila dhruvmanila added the bug Something isn't working label Aug 26, 2024
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@dhruvmanila dhruvmanila merged commit a998320 into astral-sh:main Aug 29, 2024
20 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RUF100 should probably delete an entire comment noqa is part of
2 participants