Skip to main content

validate

Function validate 

Source
pub fn validate(
    topology: &Topology,
    root: &Path,
    artifacts: Artifacts,
) -> Vec<Finding>
Expand description

Every invariant, over one topology.

artifacts says whether a static surface’s directory must already exist: a validation before a build has nothing to find, and one before serving or publishing has everything to lose by finding nothing.

use majordomus_cli::web::{model::*, validate};
let clash = Topology::new(vec![s("a", "/tests"), s("b", "/tests")]);
let findings = validate::validate(&clash, std::path::Path::new("."), validate::Artifacts::Ignore);
assert!(findings.iter().any(|f| f.rule == "surface.mount-collision"));