mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Create per-rule pages and link from README (#2644)
This commit is contained in:
@@ -21,10 +21,15 @@ def snake_case(name: str) -> str:
|
||||
).lstrip("_")
|
||||
|
||||
|
||||
def main(*, name: str, code: str, linter: str) -> None: # noqa: PLR0915
|
||||
def main(*, name: str, code: str, linter: str) -> None:
|
||||
"""Generate boilerplate for a new rule."""
|
||||
# Create a test fixture.
|
||||
with (ROOT_DIR / "crates/ruff/resources/test/fixtures" / dir_name(linter) / f"{code}.py").open(
|
||||
with (
|
||||
ROOT_DIR
|
||||
/ "crates/ruff/resources/test/fixtures"
|
||||
/ dir_name(linter)
|
||||
/ f"{code}.py"
|
||||
).open(
|
||||
"a",
|
||||
):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user