ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Displaying linter rules that are available but hasn't been configured

Open flaeppe opened this issue 1 year ago • 2 comments
trafficstars

I find myself going through the list of available rules from time to time. Either checking if there are any rules introduced since last time or if I've just missed any. I do this for various reasons, some times it's just a project with older ruff config or perhaps it's not using ruff at all and I'm copying a config from another project.

Since there are so many rules (yay!) it's quite time consuming to go through. It would've been nice if ruff, by looking at my configuration, could tell me what rules are available that I haven't considered in my configuration. Which I'm imagining, in my case, would speed up the process since I've configured more rules than not.

I guess that an option is probably to select all rules and instead ignoring rules, thus "auto including" anything new. But then looking at such a config it'll be (much) less visible which the active/enabled rules actually are.

Perhaps some flag like: --show-overlooked, --show-forgotten or --show-missing

e.g.

ruff lint --show-overlooked

Outputting:

The below lint rules are available but have not been considered in your ruff config

UP (pyupgrade) https://docs.astral.sh/ruff/rules/#pyupgrade-up
A (flake8-builtins) https://docs.astral.sh/ruff/rules/#flake8-builtins-a

Which means the above rules are not to be found under the select nor the ignore section in my config

flaeppe avatar Apr 05 '24 12:04 flaeppe

Thanks for opening this issue. I agree, keeping up with ruff rules and configuring ruff is hard work. I would go as far and say that Ruff mostly "dumbs" the responsibility on users to figure out what a reasonable rule set is.

We're currently working on #1774 where we plan to have more meaningful categories and a more opinionated default set of rules. You can think of it as us curating a rule set for you and you can do fine-tuning by opting into sub-categories.

Now, that's unrelated to what you're asking for, but I thought it was worth calling out because it might reduce the need for such a feature.

MichaReiser avatar Apr 05 '24 13:04 MichaReiser

Thank you for your fast reply. #1774 might very well reduce or remove the need to figure out some rules delta.

flaeppe avatar Apr 05 '24 13:04 flaeppe

Thanks for the clear write-up. I think my preference would be to try and solve this problem via the rule recategorization effort, rather than building more tooling around our existing configuration scheme, so going to close this for now, but we'll take it into account as we figure out the design going forward.

charliermarsh avatar May 02 '24 18:05 charliermarsh