pub trait Rule: Send + Sync {
// Required methods
fn code(&self) -> &'static str;
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn explanation(&self) -> &'static str;
fn groups(&self) -> &[RuleGroup];
fn is_fixable(&self) -> bool;
fn crawl_type(&self) -> CrawlType;
fn eval(&self, ctx: &RuleContext<'_>) -> Vec<LintViolation>;
// Provided method
fn configure(&mut self, _settings: &HashMap<String, String>) { ... }
}Expand description
Trait that all lint rules must implement.
Required Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
One-line description.
Sourcefn explanation(&self) -> &'static str
fn explanation(&self) -> &'static str
Multi-sentence explanation for AI consumers.
Sourcefn is_fixable(&self) -> bool
fn is_fixable(&self) -> bool
Can this rule auto-fix violations?
Sourcefn crawl_type(&self) -> CrawlType
fn crawl_type(&self) -> CrawlType
Which segments should be visited.
Sourcefn eval(&self, ctx: &RuleContext<'_>) -> Vec<LintViolation>
fn eval(&self, ctx: &RuleContext<'_>) -> Vec<LintViolation>
Evaluate the rule at the given context, returning violations.