mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +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
|
@ -37,7 +37,7 @@ pub fn linter(format: HelpFormat) -> Result<()> {
|
|||
.upstream_categories()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.as_ref())
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.short_code())
|
||||
.join("/"),
|
||||
prefix => prefix.to_string(),
|
||||
};
|
||||
|
@ -52,8 +52,8 @@ pub fn linter(format: HelpFormat) -> Result<()> {
|
|||
name: linter_info.name(),
|
||||
categories: linter_info.upstream_categories().map(|cats| {
|
||||
cats.iter()
|
||||
.map(|UpstreamCategory(prefix, name, ..)| LinterCategoryInfo {
|
||||
prefix: prefix.as_ref(),
|
||||
.map(|UpstreamCategory(prefix, name)| LinterCategoryInfo {
|
||||
prefix: prefix.short_code(),
|
||||
name,
|
||||
})
|
||||
.collect()
|
||||
|
@ -74,7 +74,7 @@ pub fn linter(format: HelpFormat) -> Result<()> {
|
|||
.upstream_categories()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.as_ref())
|
||||
.map(|UpstreamCategory(prefix, ..)| prefix.short_code())
|
||||
.join("/"),
|
||||
prefix => prefix.to_string(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue