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

RUF025 is remapped to C420 but now it's also a new rule #15255

Closed
oprypin opened this issue Jan 4, 2025 · 3 comments
Closed

RUF025 is remapped to C420 but now it's also a new rule #15255

oprypin opened this issue Jan 4, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@oprypin
Copy link

oprypin commented Jan 4, 2025

#12533 remapped the rule RUF025 as C420.

#15104 added a different new rule under the code RUF025.

The immediate issue is that even though RUF025 has just appeared in documentation, if you enable it, the rule doesn't actually work, and you just get the following warning:

warning: `RUF025` has been remapped to `C420`.

So I suppose (luckily?) the new rule was not actually added yet because it's impossible to use it, it only appears in docs and in the codebase.

Rule codes that were remapped from are supposed to remain reserved forever, right?

@MichaReiser
Copy link
Member

MichaReiser commented Jan 4, 2025

Rule codes that were remapped from are supposed to remain reserved forever, right?

Argh, thanks. This is such a foot gun, especially with the many holes in the Ruff code section. I assumed that the redirects are at least visible in the codes section because it's the case for deprecated rules. I'll look into this on Monday, but we should have a static check that asserts that codes and redirects don't overlap.

@MichaReiser MichaReiser self-assigned this Jan 4, 2025
@MichaReiser MichaReiser added the bug Something isn't working label Jan 4, 2025
@InSyncWithFoo
Copy link
Contributor

InSyncWithFoo commented Jan 4, 2025

@MichaReiser
Copy link
Member

So I suppose (luckily?) the new rule was not actually added yet because it's impossible to use it, it only appears in docs and in the codebase.

I think it was possible to use the rule using the ALL selector but yes, most users weren't able to use it.

Thank you @InSyncWithFoo for volunteering to fix this issue so quickly! I also want to make clear that this was entirely my fault and by no means yours, just because we skipped a few rule codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants