Skip to main content

Rule

Trait Rule 

Source
pub trait Rule: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn check(&self, ctx: &FileContext) -> Vec<Diagnostic>;

    // Provided method
    fn fix(&self, _ctx: &FileContext) -> Option<String> { ... }
}
Expand description

Every lint rule implements this trait.

Required Methods§

Source

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

Source

fn check(&self, ctx: &FileContext) -> Vec<Diagnostic>

Provided Methods§

Source

fn fix(&self, _ctx: &FileContext) -> Option<String>

Returns the fixed source if this rule supports auto-fix, None otherwise.

Implementors§