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§
fn name(&self) -> &'static str
fn check(&self, ctx: &FileContext) -> Vec<Diagnostic>
Provided Methods§
Sourcefn fix(&self, _ctx: &FileContext) -> Option<String>
fn fix(&self, _ctx: &FileContext) -> Option<String>
Returns the fixed source if this rule supports auto-fix, None otherwise.