Help us shape the future of Go! Take the 2026 Go Developer Survey

sourceignore

package module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 14

Documentation

Index

Constants

View Source
const (
	IgnoreFile   = ".sourceignore"
	ExcludeVCS   = ".git/,.gitignore,.gitmodules,.gitattributes"
	ExcludeExt   = "*.jpg,*.jpeg,*.gif,*.png,*.wmv,*.flv,*.tar.gz,*.zip"
	ExcludeCI    = "" /* 127-byte string literal not displayed */
	ExcludeExtra = "**/.goreleaser.yml,**/.sops.yaml,**/.flux.yaml"
)

Variables

This section is empty.

Functions

func DefaultPatterns

func DefaultPatterns(domain []string) []gitignore.Pattern

DefaultPatterns returns a gitignore.Pattern slice with the default ExcludeExt, ExcludeCI, ExcludeExtra patterns.

func LoadIgnorePatterns

func LoadIgnorePatterns(dir string, domain []string) ([]gitignore.Pattern, error)

LoadIgnorePatterns recursively loads the IgnoreFile patterns found in the directory.

func NewDefaultMatcher

func NewDefaultMatcher(ps []gitignore.Pattern, domain []string) gitignore.Matcher

NewDefaultMatcher returns a gitignore.Matcher with the DefaultPatterns as lowest priority patterns.

func NewMatcher

func NewMatcher(ps []gitignore.Pattern) gitignore.Matcher

NewMatcher returns a gitignore.Matcher for the given gitignore.Pattern slice. It mainly exists to compliment the API.

func ReadIgnoreFile

func ReadIgnoreFile(path string, domain []string) ([]gitignore.Pattern, error)

ReadIgnoreFile attempts to read the file at the given path and returns the read patterns.

func ReadPatterns

func ReadPatterns(reader io.Reader, domain []string) []gitignore.Pattern

ReadPatterns collects ignore patterns from the given reader and returns them as a gitignore.Pattern slice. If a domain is supplied, this is used as the scope of the read patterns.

func VCSPatterns

func VCSPatterns(domain []string) []gitignore.Pattern

VCSPatterns returns a gitignore.Pattern slice with ExcludeVCS patterns.

Types

This section is empty.

Directories

Path Synopsis
Package gitignore implements matching file system paths to gitignore patterns that can be automatically read from a git repository tree in the order of definition priorities.
Package gitignore implements matching file system paths to gitignore patterns that can be automatically read from a git repository tree in the order of definition priorities.

Jump to

Keyboard shortcuts

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