pub struct RuleConfig {Show 22 fields
pub id: String,
pub severity: Severity,
pub message: String,
pub languages: Vec<String>,
pub patterns: Vec<String>,
pub paths: Vec<String>,
pub exclude_paths: Vec<String>,
pub ignore_comments: bool,
pub ignore_strings: bool,
pub match_mode: MatchMode,
pub multiline: bool,
pub multiline_window: Option<u32>,
pub context_patterns: Vec<String>,
pub context_window: Option<u32>,
pub escalate_patterns: Vec<String>,
pub escalate_window: Option<u32>,
pub escalate_to: Option<Severity>,
pub depends_on: Vec<String>,
pub help: Option<String>,
pub url: Option<String>,
pub tags: Vec<String>,
pub test_cases: Vec<RuleTestCase>,
}Fields§
§id: String§severity: Severity§message: String§languages: Vec<String>Optional language tags (e.g. “rust”). Empty means “all”.
patterns: Vec<String>One or more regex patterns.
paths: Vec<String>Include path globs. Empty means “all”.
exclude_paths: Vec<String>Exclude path globs.
ignore_comments: bool§ignore_strings: bool§match_mode: MatchModeMatching mode:
any(default): emit when patterns matchabsent: emit when patterns do not match in the scoped file
multiline: boolEnable multi-line matching across consecutive scoped lines.
multiline_window: Option<u32>Number of consecutive scoped lines to include in a multiline window.
If omitted and multiline=true, a default of 2 lines is used.
context_patterns: Vec<String>Optional context patterns that must match near a primary match.
context_window: Option<u32>Context search window (lines before/after the matched line).
If omitted and context_patterns are set, a default of 3 is used.
escalate_patterns: Vec<String>Optional patterns that escalate severity when found near a match.
escalate_window: Option<u32>Escalation search window (lines before/after the matched line).
If omitted and escalate_patterns are set, a default of 0 (same line) is used.
escalate_to: Option<Severity>Escalation target severity. Defaults to error when escalation patterns match.
depends_on: Vec<String>Rule dependencies. This rule is only evaluated in files where all dependencies matched.
help: Option<String>Optional help text explaining how to fix violations.
url: Option<String>Optional URL with more information about the rule.
Tags for grouping/filtering rules (e.g., “debug”, “security”, “style”).
test_cases: Vec<RuleTestCase>Test cases for validating this rule.
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
Source§impl<'de> Deserialize<'de> for RuleConfig
impl<'de> Deserialize<'de> for RuleConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for RuleConfig
impl JsonSchema for RuleConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more