Skip to main content

run_script_rules

Function run_script_rules 

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

Run all script rules defined in the config against the enriched graph. Script rules are rules with a command field in [rules]. Each script rule receives { graph, options } as JSON on stdin — the enriched graph (nodes, edges, analyses) plus the rule’s options — 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.