pub fn parse_rule(yaml: &str) -> Result<Rule, RuleError>Expand description
Parse a single YAML string into a Rule, validating required fields.
A rule carries either an ast-grep rule matcher or a file-level metric
plus its threshold, never both and never neither.