Documentation
¶
Overview ¶
Package ignore matches paths against the ignore files that apply to them, for use as scan's ignore predicate. It is modelled on ripgrep's ignore handling but owned in-repo - no vendored walker or matcher: a configurable set of per-directory ignore files (default .gitignore; a .cloverignore can be added via WithFiles) sharing gitignore syntax. For a path it consults every ignore file from the repository root (via vcs) down to the path's directory, last match winning, so nested ignores and negation behave as git does. Patterns compile to RE2; parsed files are cached per directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher decides whether a path is ignored by the ignore files governing it, after the manner of ripgrep's ignore handling but owned in-repo. It is bounded by the repository root (resolved via vcs) and caches each directory's parsed patterns, so it is cheap to consult once per scanned entry.
func (*Matcher) Ignore ¶
Ignore reports whether the entry at path is ignored, suitable for scan.WithIgnore. Files outside any repository are never ignored. The ignore files from the repository root down to the path's directory are applied in order, the last matching pattern deciding - matching git, including negation.