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

option for remapped/removed rules to report an error instead of a warning #14568

Open
DetachHead opened this issue Nov 25, 2024 · 2 comments
Open
Labels
cli Related to the command-line interface

Comments

@DetachHead
Copy link

#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

@DetachHead DetachHead changed the title option for remapped/removed rules to report and error instead of a warning option for remapped/removed rules to report an error instead of a warning Nov 25, 2024
@MichaReiser MichaReiser added the cli Related to the command-line interface label Nov 25, 2024
@MichaReiser
Copy link
Member

MichaReiser commented Nov 25, 2024

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)

@DetachHead
Copy link
Author

sounds great, looking forward to red knot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command-line interface
Projects
None yet
Development

No branches or pull requests

2 participants