pub struct RuleConfig {Show 19 fields
pub id: String,
pub severity: Severity,
pub message: String,
pub suggest: Option<String>,
pub glob: Option<String>,
pub allowed_classes: Vec<String>,
pub token_map: Vec<String>,
pub pattern: Option<String>,
pub max_count: Option<usize>,
pub packages: Vec<String>,
pub regex: bool,
pub manifest: Option<String>,
pub exclude_glob: Vec<String>,
pub file_contains: Option<String>,
pub file_not_contains: Option<String>,
pub required_files: Vec<String>,
pub forbidden_files: Vec<String>,
pub condition_pattern: Option<String>,
pub skip_strings: bool,
}Expand description
Parsed rule configuration from baseline.toml.
Fields§
§id: String§severity: Severity§message: String§suggest: Option<String>§glob: Option<String>§allowed_classes: Vec<String>Classes exempt from enforcement.
token_map: Vec<String>User-provided token mappings ("raw-class=semantic-class").
pattern: Option<String>Literal pattern to search for (used by ratchet and banned-pattern rules).
max_count: Option<usize>Maximum allowed occurrences (used by ratchet rules).
packages: Vec<String>Banned package names (used by banned-import and banned-dependency rules).
regex: boolWhether pattern should be interpreted as a regex (default: false).
manifest: Option<String>Manifest filename to check (used by banned-dependency, defaults to package.json).
exclude_glob: Vec<String>Glob patterns for files to exclude from this rule.
file_contains: Option<String>Only run rule if file contains this string.
file_not_contains: Option<String>Only run rule if file does NOT contain this string.
required_files: Vec<String>Required files that must exist (used by file-presence rule).
forbidden_files: Vec<String>Forbidden files that must NOT exist (used by file-presence rule).
condition_pattern: Option<String>Condition pattern: only enforce required-pattern if this pattern is present.
skip_strings: boolWhen true, skip matches that fall inside string literals (requires ast feature).
Trait Implementations§
Source§impl Clone for RuleConfig
impl Clone for RuleConfig
Source§fn clone(&self) -> RuleConfig
fn clone(&self) -> RuleConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuleConfig
impl Debug for RuleConfig
Auto Trait Implementations§
impl Freeze for RuleConfig
impl RefUnwindSafe for RuleConfig
impl Send for RuleConfig
impl Sync for RuleConfig
impl Unpin for RuleConfig
impl UnsafeUnpin for RuleConfig
impl UnwindSafe for RuleConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more