baobao_codegen/pipeline/phases/validate/
lint.rs1use baobao_manifest::Manifest;
4
5use crate::pipeline::Diagnostic;
6
7#[derive(Debug, Clone)]
9pub struct LintInfo {
10 pub name: &'static str,
12 pub description: &'static str,
14}
15
16pub trait Lint: Send + Sync {
18 fn name(&self) -> &'static str;
20
21 fn description(&self) -> &'static str;
23
24 fn check(&self, manifest: &Manifest, diagnostics: &mut Vec<Diagnostic>);
26
27 fn info(&self) -> LintInfo {
29 LintInfo {
30 name: self.name(),
31 description: self.description(),
32 }
33 }
34}