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§
Required Methods§
Sourcefn lint(
&self,
input: &[PathBuf],
deny: DenyLevel,
compiler: &mut Compiler,
) -> Result<()>
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.