Rename checks and plugins to rules (#1739)

This commit is contained in:
Charlie Marsh 2023-01-09 01:39:51 -05:00 committed by GitHub
parent caf6c65de7
commit 59155ce9f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
195 changed files with 1132 additions and 1192 deletions

View file

@ -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")