mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
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:
parent
babe1eb7be
commit
7fc42f8f85
12 changed files with 95 additions and 95 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue