Skip to main content

Rule

Trait Rule 

Source
pub trait Rule: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn severity(&self) -> Severity;
    fn file_glob(&self) -> Option<&str>;
    fn check_file(&self, ctx: &ScanContext<'_>) -> Vec<Violation>;
}
Expand description

A lint rule that checks source files for violations.

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for this rule (e.g. "tailwind-dark-mode").

Source

fn severity(&self) -> Severity

Severity level reported when the rule fires.

Source

fn file_glob(&self) -> Option<&str>

Optional glob pattern restricting which files are scanned.

Source

fn check_file(&self, ctx: &ScanContext<'_>) -> Vec<Violation>

Scan a single file and return any violations found.

Implementors§