Documentation
¶
Overview ¶
Package augmenttest is the test double for the scanner's Augmenter seam (iss-2608291814575788): a fake augmenter that flags one fixed value the native pattern set does not see, a not-found augmenter, and Install, which registers either as the default every scanner.New picks up. It spawns no process and needs no gitleaks binary, so a consumer's test proves the consumer reports what an augmenter found, and behaves on the not-found gap, without any external tool.
Index ¶
Constants ¶
const Kind = "fake:augmented"
Kind is the kind the fake reports.
const Value = "plumbob-harvest-quiet-lantern"
Value is the value the fake flags. It is lowercase words joined by hyphens, which no native pattern matches, so a finding for it can only have come from the augmenter; it is not token-shaped.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Func ¶
type Func struct {
F func(text, file string) ([]scanner.Finding, error)
Err error
// contains filtered or unexported fields
}
Func is an Augmenter built from a scan function: Scan calls F, and an error F returns is kept and reported by Available from then on, the way the gitleaks augmenter keeps a failed run. Err, set before use, is Available's answer from the start (ErrNotFound for the gap).
func NotFound ¶
func NotFound() *Func
NotFound returns an augmenter the repository configured whose tool is not installed: Available matches scanner.ErrAugmenterNotFound, and it never scans.