Linter

Trait Linter 

Source
pub trait Linter: Send + Sync {
    type Language: Language;
    type Lint: Lint;

    // Required method
    fn lint(
        &self,
        input: &[PathBuf],
        deny: DenyLevel,
        compiler: &mut Compiler,
    ) -> Result<()>;
}
Expand description

Trait representing a generic linter for analyzing and reporting issues in smart contract source code files.

A linter can be implemented for any smart contract language supported by Foundry.

Required Associated Types§

Source

type Language: Language

The target [Language].

Source

type Lint: Lint

The Lint type.

Required Methods§

Source

fn lint( &self, input: &[PathBuf], deny: DenyLevel, compiler: &mut Compiler, ) -> Result<()>

Run all lints.

The compiler should have already been configured with all the sources necessary, as well as having performed parsing and lowering.

Should return an error based on the configured DenyLevel and the emitted diagnostics.

Implementors§

Source§

impl<'a> Linter for SolidityLinter<'a>

Source§

type Language = SolcLanguage

Source§

type Lint = SolLint