sqruff_lib::core::rules::base

Trait Rule

Source
pub trait Rule:
    CloneRule
    + DynClone
    + Debug
    + 'static
    + Send
    + Sync {
Show 15 methods // Required methods fn load_from_config( &self, _config: &AHashMap<String, Value>, ) -> Result<ErasedRule, String>; fn name(&self) -> &'static str; fn description(&self) -> &'static str; fn long_description(&self) -> &'static str; fn groups(&self) -> &'static [RuleGroups]; fn eval(&self, rule_cx: RuleContext<'_>) -> Vec<LintResult>; fn crawl_behaviour(&self) -> Crawler; // Provided methods fn lint_phase(&self) -> LintPhase { ... } fn config_ref(&self) -> &'static str { ... } fn force_enable(&self) -> bool { ... } fn dialect_skip(&self) -> &'static [DialectKind] { ... } fn code(&self) -> &'static str { ... } fn is_fix_compatible(&self) -> bool { ... } fn crawl( &self, tables: &Tables, dialect: &Dialect, fix: bool, templated_file: &TemplatedFile, tree: ErasedSegment, config: &FluffConfig, ) -> (Vec<SQLLintError>, Vec<LintFix>) { ... } fn process_lint_result( &self, res: LintResult, templated_file: &TemplatedFile, new_lerrs: &mut Vec<SQLLintError>, new_fixes: &mut Vec<LintFix>, ) { ... }
}

Required Methods§

Source

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

Source

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

Source

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

Source

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

Source

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

All the groups this rule belongs to, including ‘all’ because that is a given. There should be no duplicates and ‘all’ should be the first element.

Source

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

Source

fn crawl_behaviour(&self) -> Crawler

Provided Methods§

Source

fn lint_phase(&self) -> LintPhase

Source

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

Source

fn force_enable(&self) -> bool

Source

fn dialect_skip(&self) -> &'static [DialectKind]

Returns the set of dialects for which a particular rule should be skipped.

Source

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

Source

fn is_fix_compatible(&self) -> bool

Source

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

Source

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

Implementors§

Source§

impl Rule for RuleAL01

Source§

impl Rule for RuleAL02

Source§

impl Rule for RuleAL03

Source§

impl Rule for RuleAL05

Source§

impl Rule for RuleAL06

Source§

impl Rule for RuleAL07

Source§

impl Rule for RuleAL08

Source§

impl Rule for RuleAL09

Source§

impl Rule for RuleAM01

Source§

impl Rule for RuleAM02

Source§

impl Rule for RuleAM03

Source§

impl Rule for RuleAM04

Source§

impl Rule for RuleAM05

Source§

impl Rule for RuleAM06

Source§

impl Rule for RuleAM07

Source§

impl Rule for RuleCP01

Source§

impl Rule for RuleCP02

Source§

impl Rule for RuleCP03

Source§

impl Rule for RuleCP04

Source§

impl Rule for RuleCP05

Source§

impl Rule for RuleCV01

Source§

impl Rule for RuleCV02

Source§

impl Rule for RuleCV03

Source§

impl Rule for RuleCV04

Source§

impl Rule for RuleCV05

Source§

impl Rule for RuleCV06

Source§

impl Rule for RuleCV07

Source§

impl Rule for RuleCV08

Source§

impl Rule for RuleCV09

Source§

impl Rule for RuleCV10

Source§

impl Rule for RuleCV11

Source§

impl Rule for RuleLT01

Source§

impl Rule for RuleLT02

Source§

impl Rule for RuleLT03

Source§

impl Rule for RuleLT04

Source§

impl Rule for RuleLT05

Source§

impl Rule for RuleLT06

Source§

impl Rule for RuleLT07

Source§

impl Rule for RuleLT08

Source§

impl Rule for RuleLT09

Source§

impl Rule for RuleLT10

Source§

impl Rule for RuleLT11

Source§

impl Rule for RuleLT12

Source§

impl Rule for RuleLT13

Source§

impl Rule for RuleRF01

Source§

impl Rule for RuleRF02

Source§

impl Rule for RuleRF03

Source§

impl Rule for RuleRF04

Source§

impl Rule for RuleRF05

Source§

impl Rule for RuleRF06

Source§

impl Rule for RuleST01

Source§

impl Rule for RuleST02

Source§

impl Rule for RuleST03

Source§

impl Rule for RuleST04

Source§

impl Rule for RuleST06

Source§

impl Rule for RuleST07

Source§

impl Rule for RuleST08

Source§

impl Rule for RuleST09

Source§

impl<T: Clone + Debug + Send + Sync + 'static> Rule for RuleAL04<T>