Rename ruff crate to ruff_linter (#7529)

This commit is contained in:
Charlie Marsh 2023-09-20 02:38:27 -04:00 committed by GitHub
parent dcbd8eacd8
commit 5849a75223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4397 changed files with 93921 additions and 93915 deletions

View file

@ -23,7 +23,7 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None:
filestem = f"{prefix}{code}" if linter != "pylint" else snake_case(name)
with (
ROOT_DIR
/ "crates/ruff/resources/test/fixtures"
/ "crates/ruff_linter/resources/test/fixtures"
/ dir_name(linter)
/ f"{filestem}.py"
).open(
@ -31,7 +31,7 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None:
):
pass
plugin_module = ROOT_DIR / "crates/ruff/src/rules" / dir_name(linter)
plugin_module = ROOT_DIR / "crates/ruff_linter/src/rules" / dir_name(linter)
rule_name_snake = snake_case(name)
# Add the relevant `#testcase` macro.
@ -128,7 +128,7 @@ pub(crate) fn {rule_name_snake}(checker: &mut Checker) {{}}
)
text = ""
with (ROOT_DIR / "crates/ruff/src/codes.rs").open("r") as fp:
with (ROOT_DIR / "crates/ruff_linter/src/codes.rs").open("r") as fp:
while (line := next(fp)).strip() != f"// {linter}":
text += line
text += line
@ -147,7 +147,7 @@ pub(crate) fn {rule_name_snake}(checker: &mut Checker) {{}}
text += "".join(lines)
text += "\n"
text += fp.read()
with (ROOT_DIR / "crates/ruff/src/codes.rs").open("w") as fp:
with (ROOT_DIR / "crates/ruff_linter/src/codes.rs").open("w") as fp:
fp.write(text)
_rustfmt(rules_mod)