option for remapped/removed rules to report an error instead of a warning
DetachHead opened this issue · 2 comments
#14435 made it so that these are now reported as a warning instead of an error. however in my project i like having all checks as strict as possible, and would like my CI to fail if any outdated rules are present in my config. it would be nice if there was an option to enable the previous more strict behavior
A specific option just for remapped/removed rules seems too narrow to me. There are other configuration warnings (e.g. incompatible rules) that you may want to error on, to be as "strict as possible"
The way I envision this in Red Knot is that:
- There's a new warning severity
- Warnings in configurations are emitted as regular "diagnostics" except that they point to the configuration file rather than a python file
- There's a CLI flag (I don't remember the exact name) that allows promoting all warnings to errors OR specifying the maximum number of allowed warnings
This has the advantage that it is a generic concept and allows for workflows where warnings are accepted locally (e.g. because a possibly undefined variable isn't something that needs fixing right away) but fail in CI.
Getting there for Ruff will require refactoring our diagnostic system first and introducing a warning severity (not necessarily for rules, but the diagnostic system must support it)
sounds great, looking forward to red knot!