Run lint rules

Updated Oct 17, 2026

The linter flow is:

  1. Register rules in CstRuleStore.
  2. Build a Runner with the source, parsed result, and rule config.
  3. Call run to obtain diagnostics.
use ddlint::{linter::{CstRuleStore, RuleConfig, Runner}, parse};

let source = "input relation R(x: u32);";
let parsed = parse(source);
let store = CstRuleStore::new();
let runner = Runner::new(&store, source, &parsed, RuleConfig::new());
let diagnostics = runner.run();

assert!(diagnostics.is_empty());

When parsing produces errors, Runner::run returns no lint diagnostics and does not run rules against the recovered parse tree. Inspect and report the parser errors separately.