pub fn pass_exit_code(events: &[PolicyEvent], end: StageEnd) -> i32Expand description
What:
The exit code of a pass that did not reach Git,
from its events and its ending.
&[PolicyEvent] borrows the events of every stage of the pass.
Why:
0 means clean or warnings only,
1 means an error finding,
a fixed-transform
rejection or a pending correction,
and 2 means the pass could not decide.
In TS you’d write (pseudocode):
const exitCode = !complete ? 2 : (hasError || patchProposed) ? 1 : 0;