Remove redundant test descriptions from #test_case macros (#4713)

This commit is contained in:
Charlie Marsh 2023-05-29 18:23:56 -04:00 committed by GitHub
parent f7c2d25205
commit 5f715417e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 751 additions and 663 deletions

View file

@ -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")