sourceignore

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 9 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 WalkPolicy added in v0.8.1

func WalkPolicy(input fs.FS, read func(string) error) error

WalkPolicy visits policy paths in the same order as Flux policy loading.

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 NewRoot added in v0.8.1

func NewRoot(data, extra string) *Matcher

NewRoot builds bucket policy from its root ignore object and declared extensions.

func (*Matcher) Admit added in v0.8.1

func (m *Matcher) Admit(kept map[string]bool, name string, directory bool)

Admit records one selected entry and the parents needed to reach it.

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 slash separator) is excluded. isDir distinguishes directory-only patterns.

func (*Matcher) ReadPolicy added in v0.8.1

func (m *Matcher) ReadPolicy(name string) (string, bool)

ReadPolicy returns the bytes already read for an ignore file.

func (*Matcher) UsesDefaults added in v0.8.1

func (m *Matcher) UsesDefaults() bool

UsesDefaults reports whether the policy has no custom 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