Add easier way to gather all available rules from ruff
Since 0.2.0 version, my fuzzer CI stopped working.
In CI, first I start to search for broken files, minimize sample size and at the end minimize number of rules, that are needed to produce problem.
Minimization of rules is done via this steps:
- getting all rules from ruff - this is done via
ruff rule --allcommand and manually parsing all rules in () - splitting available rules by half and checking if ruff still produce error
- repeating until found minimal amount of rules
0.2.0 version removed rule PLR1706 which is still available in ruff rule --all with section ## Removal and ruff started to fail each time with message
ruff failed
Cause: Rule `PLR1706` was removed and cannot be selected.
At least for now I can modify a little rule parser, but probably this will be more problematic in future.
So maybe ruff could produce simple list of rules(enabled/removed etc.) like AN001,AN002 or export them to json file via rull rule --export a.json or ruff rule --available-simple?
Does ruff rule --all --output-format json work for this?
Eh.., I searched for a similar option but did not find it.
It would be good to add to this json the fields "removed'': bool and "deprecated'': bool to avoid having to parse explanation field.
Yes I was just about to open a feature request for this; currently the JSON output does not contain any information regarding whether a rule still exists. Either there should be a key or there should be a flag to exclude removed rules.