refactor(linter): separate out the category in the output of --rules

This commit is contained in:
Boshen 2023-12-13 13:21:40 +08:00
parent ca009d5995
commit 4ced3f949c
No known key found for this signature in database
GPG key ID: 234DA6A7079C6801

View file

@ -136,7 +136,9 @@ impl Linter {
for (category, rules) in rules_by_category {
writeln!(writer, "{} ({}):", category, rules.len()).unwrap();
for rule in rules {
writeln!(writer, "• {}/{}", rule.plugin_name(), rule.name()).unwrap();
// Separate the category and rule name so people don't copy the combination as a whole for `--allow` and `--deny`,
// resulting invalid rule names.
writeln!(writer, "• {}: {}", rule.plugin_name(), rule.name()).unwrap();
}
}
writeln!(writer, "Total: {}", RULES.len()).unwrap();