Skip to main content

StackComplianceRule

Trait StackComplianceRule 

Source
pub trait StackComplianceRule:
    Send
    + Sync
    + Debug {
    // Required methods
    fn id(&self) -> &str;
    fn description(&self) -> &str;
    fn check(&self, project_path: &Path) -> Result<RuleResult>;

    // Provided methods
    fn help(&self) -> Option<&str> { ... }
    fn can_fix(&self) -> bool { ... }
    fn fix(&self, project_path: &Path) -> Result<FixResult> { ... }
    fn category(&self) -> RuleCategory { ... }
}
Expand description

Trait for stack compliance rules

Implement this trait to create custom compliance rules.

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for this rule (e.g., “makefile-targets”)

Source

fn description(&self) -> &str

Human-readable description

Source

fn check(&self, project_path: &Path) -> Result<RuleResult>

Check a project for compliance

Provided Methods§

Source

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

Detailed help text (optional)

Source

fn can_fix(&self) -> bool

Whether this rule can auto-fix violations

Source

fn fix(&self, project_path: &Path) -> Result<FixResult>

Attempt to fix violations (if supported)

Source

fn category(&self) -> RuleCategory

Category of this rule

Implementors§