Encode prefixes in README headings not just in TOC (#1109)

This commit is contained in:
Phillip Verheyden
2022-12-07 08:24:49 -06:00
committed by GitHub
parent c5451cd8ad
commit b8ff209af8
5 changed files with 99 additions and 55 deletions

View File

@@ -7,6 +7,7 @@ use std::path::PathBuf;
use anyhow::Result;
use clap::Args;
use itertools::Itertools;
use ruff::checks::{CheckCategory, CheckCode};
use strum::IntoEnumIterator;
@@ -24,7 +25,11 @@ pub fn main(cli: &Cli) -> Result<()> {
// Generate the table string.
let mut output = String::new();
for check_category in CheckCategory::iter() {
output.push_str(&format!("### {}", check_category.title()));
output.push_str(&format!(
"### {} ({})",
check_category.title(),
check_category.codes().iter().map(AsRef::as_ref).join(", ")
));
output.push('\n');
output.push('\n');