mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-19 02:55:20 +00:00
many-to-one 6/9: Implement ruff_macros::map_codes
This commit is contained in:
parent
9eda286dcd
commit
c314e10e54
19 changed files with 505 additions and 271 deletions
|
@ -62,7 +62,7 @@ pub fn main(args: &Args) -> Result<()> {
|
|||
.upstream_categories()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.as_ref())
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.short_code())
|
||||
.join(", "),
|
||||
prefix => prefix.to_string(),
|
||||
};
|
||||
|
@ -104,7 +104,11 @@ pub fn main(args: &Args) -> Result<()> {
|
|||
|
||||
if let Some(categories) = linter.upstream_categories() {
|
||||
for UpstreamCategory(prefix, name) in categories {
|
||||
table_out.push_str(&format!("#### {name} ({})", prefix.as_ref()));
|
||||
table_out.push_str(&format!(
|
||||
"#### {name} ({}{})",
|
||||
linter.common_prefix(),
|
||||
prefix.short_code()
|
||||
));
|
||||
table_out.push('\n');
|
||||
table_out.push('\n');
|
||||
generate_table(&mut table_out, prefix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue