pub struct GateSpec {
pub id: GateId,
pub name: &'static str,
pub include: &'static [&'static str],
pub types: Option<&'static str>,
pub exclude: &'static [&'static str],
pub always_run: bool,
pub discovers: bool,
pub cites: &'static [RuleId],
pub run: GateFn,
}Expand description
One registry row: everything the deliveries need to know about a gate.
Fields§
§id: GateIdThe gate’s identity.
name: &'static strThe display name pre-commit shows.
include: &'static [&'static str]The subject paths this gate judges, as include globs with
{docs_root} left templated.
Every row states them, under
release:a-delivered-gate-reads-what-the-convention-owns. An empty
list judges everything the excludes leave, and a row that states one
carries a comment saying why.
types: Option<&'static str>The types: scope, when the gate takes one.
Pre-commit applies it in addition to the rendered patterns. sdd gate does not, which is why --explain prints it rather than
folding it into the answer.
exclude: &'static [&'static str]The subject paths this gate never judges, as exclude globs with
{docs_root} left templated.
always_run: boolWhether the gate runs regardless of which files changed.
discovers: boolWhether the gate resolves its own subject set rather than judging the paths it is handed.
For such a gate the discovery is the include, so
GateCtx::retained applies and the registry whitelist does not.
always_run is not this: agents-digest-size runs always and still
judges what walk_files hands it, which the registry include
narrows. --explain reads this field, so a wrong value makes the
diagnostic contradict the gate.
cites: &'static [RuleId]Every rule the gate can cite in a finding.
run: GateFnThe implementation.