Trait Lint

Source
pub trait Lint {
    type Config: DeserializeOwned;
    type Error: Error;

    const SEVERITY: Severity;
    const LINT_TYPE: LintType;

    // Required methods
    fn new(config: Self::Config) -> Result<Self, Self::Error>
       where Self: Sized;
    fn pass(
        &self,
        ast: &Ast,
        context: &Context,
        ast_context: &AstContext,
    ) -> Vec<Diagnostic>;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Lint for AlmostSwappedLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for BadStringEscapeLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for CompareNanLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for ConstantTableComparisonLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for DeprecatedLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = DeprecatedLintConfig

Source§

type Error = Infallible

Source§

impl Lint for DivideByZeroLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Complexity

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for DuplicateKeysLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for EmptyIfLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Style

Source§

type Config = EmptyIfLintConfig

Source§

type Error = Infallible

Source§

impl Lint for EmptyLoopLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Style

Source§

type Config = EmptyLoopLintConfig

Source§

type Error = Infallible

Source§

impl Lint for GlobalLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Complexity

Source§

type Config = GlobalConfig

Source§

type Error = Error

Source§

impl Lint for HighCyclomaticComplexityLint

Source§

impl Lint for IfSameThenElseLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for IfsSameCondLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for InvalidLintFilterLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for ManualTableCloneLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Complexity

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for MismatchedArgCountLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for MixedTableLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for MultipleStatementsLint

Source§

impl Lint for MustUseLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for ParentheseConditionsLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Style

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for Color3BoundsLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for IncorrectRoactUsageLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for SuspiciousUDim2NewLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for ShadowingLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Style

Source§

type Config = ShadowingConfig

Source§

type Error = Error

Source§

impl Lint for StandardLibraryLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for SuspiciousReverseLoopLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for TypeCheckInsideCallLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for UnbalancedAssignmentsLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Complexity

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for UndefinedVariableLint

Source§

const SEVERITY: Severity = Severity::Error

Source§

const LINT_TYPE: LintType = LintType::Correctness

Source§

type Config = ()

Source§

type Error = Infallible

Source§

impl Lint for UnscopedVariablesLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Complexity

Source§

type Config = UnscopedVariablesConfig

Source§

type Error = Error

Source§

impl Lint for UnusedVariableLint

Source§

const SEVERITY: Severity = Severity::Warning

Source§

const LINT_TYPE: LintType = LintType::Style

Source§

type Config = UnusedVariableConfig

Source§

type Error = Error