Trait EarlyLintPass

Source
pub trait EarlyLintPass<'ast>: Send + Sync {
    // Provided methods
    fn check_expr(&mut self, _ctx: &LintContext<'_>, _expr: &'ast Expr<'ast>) { ... }
    fn check_item_struct(
        &mut self,
        _ctx: &LintContext<'_>,
        _struct: &'ast ItemStruct<'ast>,
    ) { ... }
    fn check_item_function(
        &mut self,
        _ctx: &LintContext<'_>,
        _func: &'ast ItemFunction<'ast>,
    ) { ... }
    fn check_variable_definition(
        &mut self,
        _ctx: &LintContext<'_>,
        _var: &'ast VariableDefinition<'ast>,
    ) { ... }
    fn check_import_directive(
        &mut self,
        _ctx: &LintContext<'_>,
        _import: &'ast ImportDirective<'ast>,
    ) { ... }
    fn check_using_directive(
        &mut self,
        _ctx: &LintContext<'_>,
        _using: &'ast UsingDirective<'ast>,
    ) { ... }
    fn check_item_contract(
        &mut self,
        _ctx: &LintContext<'_>,
        _contract: &'ast ItemContract<'ast>,
    ) { ... }
    fn check_full_source_unit(
        &mut self,
        _ctx: &LintContext<'_>,
        _ast: &'ast SourceUnit<'ast>,
    ) { ... }
}
Expand description

Trait for lints that operate directly on the AST. Its methods mirror solar_ast::visit::Visit, with the addition of LintCotext.

Provided Methods§

Source

fn check_expr(&mut self, _ctx: &LintContext<'_>, _expr: &'ast Expr<'ast>)

Source

fn check_item_struct( &mut self, _ctx: &LintContext<'_>, _struct: &'ast ItemStruct<'ast>, )

Source

fn check_item_function( &mut self, _ctx: &LintContext<'_>, _func: &'ast ItemFunction<'ast>, )

Source

fn check_variable_definition( &mut self, _ctx: &LintContext<'_>, _var: &'ast VariableDefinition<'ast>, )

Source

fn check_import_directive( &mut self, _ctx: &LintContext<'_>, _import: &'ast ImportDirective<'ast>, )

Source

fn check_using_directive( &mut self, _ctx: &LintContext<'_>, _using: &'ast UsingDirective<'ast>, )

Source

fn check_item_contract( &mut self, _ctx: &LintContext<'_>, _contract: &'ast ItemContract<'ast>, )

Source

fn check_full_source_unit( &mut self, _ctx: &LintContext<'_>, _ast: &'ast SourceUnit<'ast>, )

Should be called after the source unit has been visited. Enables lints that require knowledge of the entire AST to perform their analysis.

Implementors§

Source§

impl<'ast> EarlyLintPass<'ast> for AsmKeccak256

Source§

impl<'ast> EarlyLintPass<'ast> for IncorrectShift

Source§

impl<'ast> EarlyLintPass<'ast> for UncheckedCall

Source§

impl<'ast> EarlyLintPass<'ast> for UncheckedTransferERC20

WARN: can issue false positives. It does not check that the contract being called is an ERC20.

Source§

impl<'ast> EarlyLintPass<'ast> for Imports

Source§

impl<'ast> EarlyLintPass<'ast> for MixedCaseFunction

Source§

impl<'ast> EarlyLintPass<'ast> for MixedCaseVariable

Source§

impl<'ast> EarlyLintPass<'ast> for PascalCaseStruct

Source§

impl<'ast> EarlyLintPass<'ast> for ScreamingSnakeCase

Source§

impl<'ast> EarlyLintPass<'ast> for DivideBeforeMultiply