Merge Availability and AutofixKind (#3629)

This commit is contained in:
Jonathan Plasse 2023-03-20 17:45:33 +01:00 committed by GitHub
parent 7c0f17279c
commit fd39ec4bdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 70 additions and 72 deletions

View file

@ -2,6 +2,7 @@
use itertools::Itertools;
use ruff::registry::{Linter, Rule, RuleNamespace, UpstreamCategory};
use ruff_diagnostics::AutofixKind;
use strum::IntoEnumIterator;
const FIX_SYMBOL: &str = "🛠";
@ -13,8 +14,8 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
table_out.push('\n');
for rule in rules {
let fix_token = match rule.autofixable() {
None => "",
Some(_) => FIX_SYMBOL,
AutofixKind::None => "",
AutofixKind::Always | AutofixKind::Sometimes => FIX_SYMBOL,
};
let rule_name = rule.as_ref();