refactor: Rename RuleOrigin to Linter

"origin" was accurate since ruff rules are currently always modeled
after one origin (except the Ruff-specific rules).

Since we however want to introduce a many-to-many mapping between codes
and rules, the term "origin" no longer makes much sense. Rules usually
don't have multiple origins but one linter implements a rule first and
then others implement it later (often inspired from another linter).
But we don't actually care much about where a rule originates from when
mapping multiple rule codes to one rule implementation, so renaming
RuleOrigin to Linter is less confusing with the many-to-many system.
This commit is contained in:
Martin Fischer 2023-01-20 14:27:27 +01:00 committed by Charlie Marsh
parent babe1eb7be
commit 7fc42f8f85
12 changed files with 95 additions and 95 deletions

View file

@ -5,13 +5,13 @@ from pathlib import Path
ROOT_DIR = Path(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
def dir_name(origin: str) -> str:
return origin.replace("-", "_")
def dir_name(linter_name: str) -> str:
return linter_name.replace("-", "_")
def pascal_case(origin: str) -> str:
def pascal_case(linter_name: str) -> str:
"""Convert from snake-case to PascalCase."""
return "".join(word.title() for word in origin.split("-"))
return "".join(word.title() for word in linter_name.split("-"))
def get_indent(line: str) -> str: