Expand description
Typed settings and their defaults.
What:
The typed settings a validated cli-git.config.jsonc produces,
with defaults.
Why:
The policy engine and transactions read plain typed values,
never JSON.
In TS you’d write (pseudocode):
// type CliGitConfig = { policies: PolicyConfig; concurrency: ConcurrencyConfig };Structs§
- CliGit
Config - What:
The complete validated configuration of one repository.
Why:
A repository without a file and a repository with an empty
{}file both yieldCliGitConfig::defaults(): a policy that is off unless listed stays off either way. - Concurrency
Config - What: The three concurrent-commit tuning groups together. Why: None of them disables the commit transaction; they only tune it.
- Forbidden
Strings Options - What:
Validated options of
security/forbidden-strings.Option<String>is “a configured file name or nothing”. Why: The scanner is linked into cli-git, so the remaining choices are whether its embedded baseline rules run and which repository file holds the private rules. There is deliberately no executable path. - Hooks
Config - What:
Hook serialization tuning (
hookskey). Why:falseserializes preparation and post-landing hooks through the hook lock. - Index
Lock Config - What:
Foreign
index.lockpatience (indexLockkey). Why: A lock whose owner cannot be proven alive is waited on only this long. - Landing
Config - What:
Landing starvation tuning (
landingkey). Why: A commit that keeps losing landing races eventually reserves the next slot. - Markdown
Autofix Options - What:
Validated options of
markdown/autofix.Vec<T>is an owned growable list (siblings:&[T]borrowed,[T; N]fixed).Stringis owned text (sibling:&strborrowed). Why: The settings outlive the parsed document, so they own their lists and text. There is deliberately no command or executable field. - Policy
Config - What: Every policy’s severity plus the option records of option-bearing policies. Why: One value answers “does this policy run, how strictly, with what options”.
- Policy
Setting - What:
The effective severity of one shipped policy.
#[derive(...)]generates copy, debug printing and==for the struct. Why:explicitseparates “the repository chose this” from “the default applied”; only an explicit unsafewarnearns a configuration warning.
Enums§
- Markdown
Rule - What: The closed set of Markdown rules the commit-time policy may run. Why: The shipped policy runs the owned linter with a fixed rule list; an unknown rule name is a configuration error, never a pass-through argument.
Constants§
- DEFAULT_
RESERVE_ AFTER_ LOST_ RACES - Incumbent default: reserve the next landing slot after one lost landing race.
- DEFAULT_
UNPROVEN_ OWNER_ TIMEOUT_ MS - What:
u64constant, an unsigned 64-bit integer (siblingsu32,usize,i64). Why: Milliseconds up to 2^53 - 1 are accepted, whichu32cannot hold. This is the incumbent’s default patience for an unprovenindex.lockowner.
Functions§
- markdown_
rule_ from_ name - What:
Translate a configured rule name into its typed rule.
Option<T>is “value or nothing”:Some(rule)orNone. Why: Only shipped rules exist; the caller reports any other name with its key. - markdown_
rule_ name - What:
Translate a typed rule back to its configuration spelling.
&'static strborrows text compiled into the executable for its whole run. Why: Diagnostics and the later linter invocation print the accepted spelling. - unlisted_
severity - What:
The severity of a policy the repository configuration does not name.
&PolicyDescriptorborrows the policy’s registry row. Why: The five built-in policies run everywhere at their default severity. The four policies that plugins used to provide run only wherecli-git.config.jsoncnames them, whether or not a file exists, so an empty file and no file behave alike.