Improve display of rules in --show-settings (#11003)

Closes https://github.com/astral-sh/ruff/issues/11002
This commit is contained in:
Zanie Blue 2024-04-17 15:18:41 -05:00 committed by GitHub
parent 0a6327418d
commit 16cc9bd78d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 123 additions and 121 deletions

View file

@ -291,7 +291,9 @@ impl Display for RuleSet {
} else {
writeln!(f, "[")?;
for rule in self {
writeln!(f, "\t{rule:?},")?;
let name = rule.as_ref();
let code = rule.noqa_code();
writeln!(f, "\t{name} ({code}),")?;
}
write!(f, "]")?;
}