Skip to main content

run_script_rules

Function run_script_rules 

Source
pub fn run_script_rules(
    graph: &Graph,
    root: &Path,
    config: &Config,
) -> Vec<Diagnostic>
Expand description

Run all script rules defined in the config against the graph. Script rules are rules with a command field in [rules]. Each script rule receives the graph as JGF JSON on stdin and emits diagnostics as newline-delimited JSON on stdout.

Expected output format per line: {“message”: “…”, “source”: “…”, “target”: “…”, “node”: “…”, “fix”: “…”}

All fields except message are optional. The rule and severity fields are set by drft from the config — the script doesn’t need to provide them.