mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Create per-rule pages and link from README (#2644)
This commit is contained in:
parent
f1cdd108e6
commit
271e4fda8c
17 changed files with 156 additions and 40 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue