Expand description
The refusal of a direct command whose --policy selects a policy that is off.
What:
The --policy selection of a direct git cli-git check or fix:
the names turned into shipped policies,
and the refusal of a selection that names a policy which is off.
Why:
A mistyped policy ID must stop the command instead of selecting nothing.
A policy that is off runs nothing,
so a run limited to it would exit 0 with no output and read as “checked and clean”.
A CI step or a person who selected the policy by name must learn that it did not run,
and which cli-git.config.jsonc key turns it on.
The commit,
add and push lifecycles are not direct runs and keep skipping policies that are off.
In TS you’d write (pseudocode):
// const ids = names.map(shippedPolicy); const off = ids.filter(id => config.severity(id) === 'off'); if (off.length) throw new ConfigError(...);Functions§
- selected_
policies - What:
Turn the selected policy names into policy identities.
Result<Vec<PolicyId>, ConfigError>is the identities, or the error naming the first name no shipped policy has. Why:--policyselects among shipped policies only; a mistyped ID must stop the command instead of selecting nothing. - selection_
error - What:
The refusal for a direct command,
when any selected policy has severity
off, or is on but does not run for this command;Nonewhen nothing is selected or every selected policy runs.&[PolicyId]is the--policyselection,&PolicyConfigthe severities in effect, andtriggerisDirectCheckorDirectFix. Why: One message names every such policy, in selection order, so a repeated--policyis answered once and a run never silently drops a selected policy.