Skip to main content

Rule

Trait Rule 

Source
pub trait Rule: Send + Sync {
    // Required methods
    fn id(&self) -> RuleId;
    fn name(&self) -> &'static str;
    fn default_severity(&self) -> Severity;
    fn check(&self, attrs: &IsmAttributes, ctx: &RuleContext) -> Vec<Diagnostic>;
}
Expand description

The core trait every rule implementation must satisfy.

Rules are stateless. All configuration (severity overrides, corrections map) is resolved by the engine before rule invocation and passed via context.

Required Methods§

Source

fn id(&self) -> RuleId

Source

fn name(&self) -> &'static str

Source

fn default_severity(&self) -> Severity

Default severity — overridable per rule in .marque.toml.

Source

fn check(&self, attrs: &IsmAttributes, ctx: &RuleContext) -> Vec<Diagnostic>

Implementors§