[][src]Trait selene_lib::rules::Rule

pub trait Rule {
    type Config: DeserializeOwned;
    type Error: Error;
    fn new(config: Self::Config) -> Result<Self, Self::Error>
    where
        Self: Sized
;
fn pass(&self, ast: &Ast<'static>, context: &Context) -> Vec<Diagnostic>;
fn severity(&self) -> Severity;
fn rule_type(&self) -> RuleType; fn allow(&self) -> bool { ... } }

Associated Types

Loading content...

Required methods

fn new(config: Self::Config) -> Result<Self, Self::Error> where
    Self: Sized

fn pass(&self, ast: &Ast<'static>, context: &Context) -> Vec<Diagnostic>

fn severity(&self) -> Severity

fn rule_type(&self) -> RuleType

Loading content...

Provided methods

fn allow(&self) -> bool

Loading content...

Implementors

impl Rule for AlmostSwappedLint[src]

type Config = ()

type Error = Infallible

impl Rule for DivideByZeroLint[src]

type Config = ()

type Error = Infallible

impl Rule for EmptyIfLint[src]

type Config = EmptyIfLintConfig

type Error = Infallible

impl Rule for GlobalLint[src]

type Config = ()

type Error = Infallible

impl Rule for IfSameThenElseLint[src]

type Config = ()

type Error = Infallible

impl Rule for IfsSameCondLint[src]

type Config = ()

type Error = Infallible

impl Rule for IncorrectRoactUsageLint[src]

type Config = ()

type Error = Infallible

impl Rule for MultipleStatementsLint[src]

type Config = MultipleStatementsConfig

type Error = Infallible

impl Rule for ParentheseConditionsLint[src]

type Config = ()

type Error = Infallible

impl Rule for ShadowingLint[src]

type Config = ShadowingConfig

type Error = Error

impl Rule for StandardLibraryLint[src]

type Config = ()

type Error = Infallible

impl Rule for SuspiciousReverseLoopLint[src]

type Config = ()

type Error = Infallible

impl Rule for UnbalancedAssignmentsLint[src]

type Config = ()

type Error = Infallible

impl Rule for UndefinedVariableLint[src]

type Config = ()

type Error = Infallible

impl Rule for UnscopedVariablesLint[src]

type Config = UnscopedVariablesConfig

type Error = Error

impl Rule for UnusedVariableLint[src]

type Config = UnusedVariableConfig

type Error = Error

Loading content...