pub mod custom;
pub mod directed_cycle;
pub mod fragmentation;
pub mod orphan_node;
pub mod schema_violation;
pub mod stale;
pub mod symlink_edge;
pub mod unresolved_edge;
use crate::analyses::EnrichedGraph;
use crate::diagnostic::Diagnostic;
pub struct RuleContext<'a> {
pub graph: &'a EnrichedGraph,
pub options: Option<&'a toml::Value>,
}
pub trait Rule {
fn name(&self) -> &str;
fn evaluate(&self, ctx: &RuleContext) -> Vec<Diagnostic>;
}
pub fn all_rules() -> Vec<Box<dyn Rule>> {
vec![
Box::new(directed_cycle::DirectedCycleRule),
Box::new(fragmentation::FragmentationRule),
Box::new(orphan_node::OrphanNodeRule),
Box::new(schema_violation::SchemaViolationRule),
Box::new(stale::StaleRule),
Box::new(symlink_edge::SymlinkEdgeRule),
Box::new(unresolved_edge::UnresolvedEdgeRule),
]
}