mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
![]() ruff_dev::generate_rules_table previously documented which rules are autofixable via DiagnosticKind::fixable ... since the DiagnosticKind was obtained via Rule::kind (and Violation::placeholder) which we both want to get rid of we have to obtain the autofixability via another way. This commit implements such another way by adding an AUTOFIX associated constant to the Violation trait. The constant is of the type Option<AutoFixkind>, AutofixKind is a new struct containing an Availability enum { Sometimes, Always}, letting us additionally document that some autofixes are only available sometimes (which previously wasn't documented). We intentionally introduce this information in a struct so that we can easily introduce further autofix metadata in the future such as autofix applicability[1]. [1]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_errors/enum.Applicability.html |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |