Expand description
Guards: named checks over any file in the repository and over commit messages, such as the gate that keeps internal names out of a public package.
Re-exports§
pub use range::GuardRange;
Modules§
- range
- What a guard looks at: the index, the commits about to be pushed, or the whole tree.
- secrets
- Built-in secret patterns. Deliberately narrow: each one is a format with a fixed prefix or
header, so a hit is almost always real. Two shapes need a second look: a connection string
(
scheme://user:password@host) is skipped when its host is an example or loopback host or its password is a placeholder, and a JWT is skipped when it is the well-known jwt.io sample. - terms
- Denied terms: gathered from the guard, a file outside the repository, or an environment variable, and matched case-insensitively. Terms are never printed in full.
Functions§
- builtin_
secrets - The built-in secret patterns over
blobs, with no guard configured: the checkspec exportalways runs. Hits are errors namedsecrets; matched values are never in the message. - reads_
content - Guards that read content for secrets or denied text, the ones an upload must pass.
- run
- Runs the named guards (all of them when
namesis empty). A guard without an explicit range uses its own default; a guard with a baseline reports only hits the baseline does not hold. - scan_
blobs - Runs the guards
pickselects over (label, bytes) about to leave the repository, each with its own settings whatever its paths; deny_files and path patterns read the label. Baselines do not apply, a known hit is still leaving. Each finding names the guard that raised it. - write_
baselines - Measures each named guard over the whole tree and writes its baseline file.
With
writefalse, only measures: what--write-baselinewould record, for its preview.