mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-09 22:25:20 +00:00
Rename ruff
crate to ruff_linter
(#7529)
This commit is contained in:
parent
dcbd8eacd8
commit
5849a75223
4397 changed files with 93921 additions and 93915 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue