ruff icon indicating copy to clipboard operation
ruff copied to clipboard

"ALL" should ignore deprecated rules

Open philippgl opened this issue 1 year ago • 9 comments

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

philippgl avatar Mar 11 '24 15:03 philippgl

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 avatar Mar 11 '24 15:03 zanieb

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.

philippgl avatar Mar 11 '24 16:03 philippgl

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

zanieb avatar Mar 11 '24 16:03 zanieb

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

zanieb avatar Mar 11 '24 16:03 zanieb

@zanieb Hi! Can I take it?

WindowGenerator avatar Mar 11 '24 20:03 WindowGenerator

@WindowGenerator go for it!

zanieb avatar Mar 11 '24 21:03 zanieb

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

philippgl avatar Mar 12 '24 12:03 philippgl

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.

marc-benz avatar May 17 '24 15:05 marc-benz

@marc-benz That was discussed a bit in https://github.com/astral-sh/ruff/issues/9778 I guess? I'm pretty hesitant to add that though. They'd also be ignored by switchingpreview on in your config.

zanieb avatar May 17 '24 18:05 zanieb