mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 22:10:48 -05:00
refactor: Turn RuleSelector into a newtype around RuleCodePrefix
Yet another refactor to let us implement the many-to-many mapping
between codes and rules in a prefix-agnostic way.
We want to break up the RuleCodePrefix[1] enum into smaller enums.
To facilitate that this commit introduces a new wrapping type around
RuleCodePrefix so that we can start breaking it apart.
[1]: Actually `RuleCodePrefix` is the previous name of the autogenerated
enum ... I renamed it in b19258a243 to
RuleSelector since `ALL` isn't a prefix. This commit now renames it back
but only because the new `RuleSelector` wrapper type, introduced in this
commit, will let us move the `ALL` variant from `RuleCodePrefix` to
`RuleSelector` in the next commit.
This commit is contained in:
committed by
Charlie Marsh
parent
a20482961b
commit
abc9810e2b
@@ -3,11 +3,12 @@ use std::path::PathBuf;
|
||||
use clap::{command, Parser};
|
||||
use regex::Regex;
|
||||
use ruff::logging::LogLevel;
|
||||
use ruff::registry::{Rule, RuleSelector};
|
||||
use ruff::registry::Rule;
|
||||
use ruff::resolver::ConfigProcessor;
|
||||
use ruff::settings::types::{
|
||||
FilePattern, PatternPrefixPair, PerFileIgnore, PythonVersion, SerializationFormat,
|
||||
};
|
||||
use ruff::RuleSelector;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
|
||||
Reference in New Issue
Block a user