glinter/rule
Types
pub type LintResult {
LintResult(
rule: String,
severity: Severity,
file: String,
location: glance.Span,
message: String,
)
}
Constructors
-
LintResult( rule: String, severity: Severity, file: String, location: glance.Span, message: String, )
Pre-computed data from a single AST traversal. Rules receive this instead of walking the AST themselves.
pub type ModuleData {
ModuleData(
module: glance.Module,
expressions: List(glance.Expression),
statements: List(glance.Statement),
)
}
Constructors
-
ModuleData( module: glance.Module, expressions: List(glance.Expression), statements: List(glance.Statement), )
pub type Rule {
Rule(
name: String,
default_severity: Severity,
check: fn(ModuleData, String) -> List(LintResult),
)
}
Constructors
-
Rule( name: String, default_severity: Severity, check: fn(ModuleData, String) -> List(LintResult), )