mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:35 +00:00
refactor: Move rule-specific details out of mod.rs via type aliases
This commit is contained in:
parent
005f5d7911
commit
f4cf48d885
3 changed files with 7 additions and 6 deletions
|
@ -7,8 +7,11 @@ use crate::ast::types::Range;
|
|||
use crate::checkers::ast::Checker;
|
||||
use crate::define_violation;
|
||||
use crate::registry::Diagnostic;
|
||||
use crate::settings::hashable::HashableHashMap;
|
||||
use crate::violation::Violation;
|
||||
|
||||
pub type Settings = HashableHashMap<String, ApiBan>;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||
pub struct ApiBan {
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
use self::banned_api::ApiBan;
|
||||
use self::relative_imports::Strictness;
|
||||
use crate::settings::hashable::HashableHashMap;
|
||||
|
||||
pub mod options;
|
||||
|
||||
pub mod banned_api;
|
||||
|
@ -9,6 +5,6 @@ pub mod relative_imports;
|
|||
|
||||
#[derive(Debug, Hash, Default)]
|
||||
pub struct Settings {
|
||||
pub ban_relative_imports: Strictness,
|
||||
pub banned_api: HashableHashMap<String, ApiBan>,
|
||||
pub ban_relative_imports: relative_imports::Settings,
|
||||
pub banned_api: banned_api::Settings,
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ use crate::define_violation;
|
|||
use crate::registry::Diagnostic;
|
||||
use crate::violation::Violation;
|
||||
|
||||
pub type Settings = Strictness;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema, Default)]
|
||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||
pub enum Strictness {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue