-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ruff
] Implement redirected-noqa
(RUF101
)
#11052
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
Conversation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF100 | 2 | 1 | 1 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+3 -1 violations, +0 -0 fixes in 2 projects; 42 projects unchanged)
DisnakeDev/disnake (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ disnake/utils.py:1161:56: RUF101 [*] `PGH001` is a redirect to `S307`
RasaHQ/rasa (+2 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
- tests/graph_components/validators/test_default_recipe_validator.py:815:64: RUF100 [*] Unused `noqa` directive (non-enabled: `B035`) + tests/graph_components/validators/test_default_recipe_validator.py:815:64: RUF100 [*] Unused `noqa` directive (non-enabled: `RUF011`) + tests/graph_components/validators/test_default_recipe_validator.py:815:72: RUF101 [*] `RUF011` is a redirect to `B035`
Changes by rule (2 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF101 | 2 | 2 | 0 | 0 | 0 |
RUF100 | 2 | 1 | 1 | 0 | 0 |
Co-authored-by: Micha Reiser <micha@reiser.io>
Co-authored-by: Micha Reiser <micha@reiser.io>
Sorry, I know this is blocked on my review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for taking the time 😄 |
Summary
Based on discussion in #10850.
As it stands today
RUF100
will attempt to replace code redirects with their target codes even though this is not the "goal" ofRUF100
. This behavior is confusing and inconsistent, since code redirects which don't otherwise violateRUF100
will not be updated. The behavior is also undocumented. Additionally, users who want to useRUF100
but do not want to update redirects have no way to opt out.This PR explicitly detects redirects with a new rule
RUF101
and patchesRUF100
to keep original codes in fixes and reporting.Test Plan
Added fixture.