mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 15:47:41 +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
|
@ -78,10 +78,10 @@ mod tests {
|
|||
fp.write(f"{indent}{pascal_case(plugin)},")
|
||||
fp.write("\n")
|
||||
|
||||
elif line.strip() == "RuleOrigin::Ruff => Prefixes::Single(RuleCodePrefix::RUF),":
|
||||
elif line.strip() == "Linter::Ruff => Prefixes::Single(RuleCodePrefix::RUF),":
|
||||
prefix = 'todo!("Fill-in prefix after generating codes")'
|
||||
fp.write(
|
||||
f"{indent}RuleOrigin::{pascal_case(plugin)} => Prefixes::Single({prefix}),"
|
||||
f"{indent}Linter::{pascal_case(plugin)} => Prefixes::Single({prefix}),"
|
||||
)
|
||||
fp.write("\n")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue