mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 02:53:01 +00:00
Rename checks and plugins to rules (#1739)
This commit is contained in:
parent
caf6c65de7
commit
59155ce9f6
195 changed files with 1132 additions and 1192 deletions
|
|
@ -43,8 +43,8 @@ def main(*, name: str, code: str, plugin: str) -> None:
|
|||
|
||||
with open(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}/mod.rs"), "w") as fp:
|
||||
for line in content.splitlines():
|
||||
if line.strip() == "fn diagnostics(check_code: RuleCode, path: &Path) -> Result<()> {":
|
||||
indent = line.split("fn diagnostics(check_code: RuleCode, path: &Path) -> Result<()> {")[0]
|
||||
if line.strip() == "fn rules(check_code: RuleCode, path: &Path) -> Result<()> {":
|
||||
indent = line.split("fn rules(check_code: RuleCode, path: &Path) -> Result<()> {")[0]
|
||||
fp.write(f'{indent}#[test_case(RuleCode::{code}, Path::new("{code}.py"); "{code}")]')
|
||||
fp.write("\n")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue