Trait sqruff_lib::core::rules::base::Rule

source ·
pub trait Rule: CloneRule + DynClone + Debug + 'static + Send + Sync {
    // Required methods
    fn load_from_config(&self, _config: &AHashMap<String, Value>) -> ErasedRule;
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn eval(&self, rule_cx: RuleContext<'_>) -> Vec<LintResult>;
    fn crawl_behaviour(&self) -> Crawler;

    // Provided methods
    fn lint_phase(&self) -> &'static str { ... }
    fn config_ref(&self) -> &'static str { ... }
    fn groups(&self) -> &'static [&'static str] { ... }
    fn code(&self) -> &'static str { ... }
    fn is_fix_compatible(&self) -> bool { ... }
    fn crawl(
        &self,
        dialect: &Dialect,
        fix: bool,
        tree: ErasedSegment,
        config: &FluffConfig
    ) -> (Vec<SQLLintError>, Vec<LintFix>) { ... }
    fn process_lint_result(
        &self,
        res: LintResult,
        new_lerrs: &mut Vec<SQLLintError>,
        new_fixes: &mut Vec<LintFix>
    ) { ... }
}

Required Methods§

source

fn load_from_config(&self, _config: &AHashMap<String, Value>) -> ErasedRule

source

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

source

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

source

fn eval(&self, rule_cx: RuleContext<'_>) -> Vec<LintResult>

source

fn crawl_behaviour(&self) -> Crawler

Provided Methods§

source

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

source

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

source

fn groups(&self) -> &'static [&'static str]

source

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

source

fn is_fix_compatible(&self) -> bool

source

fn crawl( &self, dialect: &Dialect, fix: bool, tree: ErasedSegment, config: &FluffConfig ) -> (Vec<SQLLintError>, Vec<LintFix>)

source

fn process_lint_result( &self, res: LintResult, new_lerrs: &mut Vec<SQLLintError>, new_fixes: &mut Vec<LintFix> )

Implementors§