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

"ALL" should ignore deprecated rules #10342

Closed
philippgl opened this issue Mar 11, 2024 · 9 comments
Closed

"ALL" should ignore deprecated rules #10342

philippgl opened this issue Mar 11, 2024 · 9 comments
Assignees
Labels
good first issue Good for newcomers rule-selection Related to enabling or disabling rules
Milestone

Comments

@philippgl
Copy link

It would be nice, if --select=ALL would ignore already deprecated rules.

I think, situations, where you select "ALL", but do not want to ignore already deprecated rules are rare (but this is just a gut feeling).

see also #9778

@zanieb
Copy link
Member

zanieb commented Mar 11, 2024

I don't think we can have deprecation be a breaking change i.e. a rule turns off when it was previously on. It's an interesting idea though.

I think it would make a lot of sense to deselect these in preview mode (if we don't already? I think we do?).

@zanieb zanieb added configuration Related to settings and configuration linter Related to the linter rule-selection Related to enabling or disabling rules and removed configuration Related to settings and configuration linter Related to the linter labels Mar 11, 2024
@philippgl
Copy link
Author

It is turned off in preview mode.
But I guess, that "ALL" can break already by enabling new rules, so breaking is expected, if using "ALL"

From https://docs.astral.sh/ruff/linter/#rule-selection:

Use ALL with discretion. Enabling ALL will implicitly enable new rules whenever you upgrade.

@zanieb
Copy link
Member

zanieb commented Mar 11, 2024

Hm that's fair... I do prefer this to #9778 so okay let's do it :)

@zanieb zanieb added the good first issue Good for newcomers label Mar 11, 2024
@zanieb zanieb self-assigned this Mar 11, 2024
@zanieb
Copy link
Member

zanieb commented Mar 11, 2024

I'm going to assign myself but if anyone is interested in grabbing this feel free and I'll just be the reviewer.

@WindowGenerator
Copy link
Contributor

@zanieb Hi!
Can I take it?

@zanieb
Copy link
Member

zanieb commented Mar 11, 2024

@WindowGenerator go for it!

@philippgl
Copy link
Author

Wow, thanks. This is just my second issue here and I have to say, that you are as fast as ruff...

@marc-benz
Copy link

Could it also make sense, to add a configuration option in the pyproject.toml that automatically ignores all deprecated rules?
Or is this already possible.

@zanieb
Copy link
Member

zanieb commented May 17, 2024

@marc-benz That was discussed a bit in #9778 I guess? I'm pretty hesitant to add that though. They'd also be ignored by switchingpreview on in your config.

@MichaReiser MichaReiser mentioned this issue Jun 26, 2024
@MichaReiser MichaReiser added this to the v0.5.0 milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers rule-selection Related to enabling or disabling rules
Projects
None yet
Development

No branches or pull requests

5 participants