sourceignore

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sourceignore builds Flux artifact-exclusion policy from in-tree .sourceignore files and caller-supplied spec.ignore patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PruneDir added in v0.7.3

func PruneDir(name string, scan bool) bool

PruneDir applies shared directory exclusions, including Helm directories during scans.

func Select added in v0.7.3

func Select[V any](policy *Matcher, candidates map[string]V, files []string)

Select removes excluded regular-file names using captured policy. Non-nil files restrict policy to those ignore files without rereading them.

Types

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher reports whether a path within a source tree is excluded from the artifact and retains the parsed ignore-file content. It is safe for concurrent reads.

func NewFS added in v0.7.3

func NewFS(input fs.FS, files []string, extra string, withDefaults bool) (*Matcher, error)

NewFS builds Flux policy from a slash-named immutable filesystem. Nil files walks the input; a supplied list MUST contain every relative ignore file. Parent rules MUST precede nested rules, independent of filesystem listing order. Defaults apply only without parsed user patterns; extra patterns have final priority.

func (*Matcher) Evidence added in v0.7.3

func (m *Matcher) Evidence() []struct{ Path, Data string }

Evidence returns the ordered ignore-file paths and exact content parsed by NewFS.

func (*Matcher) Match

func (m *Matcher) Match(rel string, isDir bool) bool

Match reports whether rel (a path relative to the matcher's root, using the OS separator) is excluded. isDir distinguishes directory-only patterns.

func (*Matcher) WithExtra added in v0.7.3

func (m *Matcher) WithExtra(extra string) *Matcher

WithExtra replaces caller patterns while retaining the parsed ignore-file policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL