Linter

Trait Linter 

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

    // Required methods
    fn configure(&self, compiler: &mut Compiler);
    fn lint(&self, input: &[PathBuf], compiler: &mut Compiler);

    // Provided method
    fn init(&self) -> Compiler { ... }
}
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 configure(&self, compiler: &mut Compiler)

Configure a solar [Compiler] from the given linter config.

Source

fn lint(&self, input: &[PathBuf], compiler: &mut Compiler)

Run all lints.

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

Provided Methods§

Source

fn init(&self) -> Compiler

Build a solar [Compiler] from the given linter config.

Implementors§

Source§

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

Source§

type Language = SolcLanguage

Source§

type Lint = SolLint