mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:49:50 +00:00
Remove redundant test descriptions from #test_case
macros (#4713)
This commit is contained in:
parent
f7c2d25205
commit
5f715417e0
43 changed files with 751 additions and 663 deletions
|
@ -46,13 +46,7 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None:
|
|||
indent = get_indent(line)
|
||||
filestem = f"{prefix}{code}" if linter != "pylint" else snake_case(name)
|
||||
lines.append(
|
||||
f'{indent}#[test_case(Rule::{name}, Path::new("{filestem}.py");'
|
||||
f' "{prefix}{code}")]',
|
||||
)
|
||||
lines.sort(
|
||||
key=lambda line: line.split('Path::new("')[1]
|
||||
if linter != "pylint"
|
||||
else line.split(");")[1],
|
||||
f'{indent}#[test_case(Rule::{name}, Path::new("{filestem}.py"))]',
|
||||
)
|
||||
fp.write("\n".join(lines))
|
||||
fp.write("\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue