sourceignore

package
v0.8.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func PruneDir(name string, scan bool) bool

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

func Select

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

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

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

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