ignore

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AzdxIgnoreFile is the name of the azd extension ignore file.
	AzdxIgnoreFile = ".azdxignore"

	// GitIgnoreFile is the name of the standard git ignore file.
	GitIgnoreFile = ".gitignore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

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

Matcher evaluates whether a path should be ignored based on patterns loaded from .azdxignore and .gitignore files found in the root directory. A nil Matcher is safe to use and never ignores anything.

func NewMatcher

func NewMatcher(root string) (*Matcher, error)

NewMatcher creates a Matcher that loads ignore patterns from the given root directory. It loads both .azdxignore and .gitignore. Patterns are evaluated additively — a path is ignored if it matches ANY pattern in EITHER file. This means .gitignore negation patterns (!) cannot un-ignore paths that are matched by .azdxignore, since each file is parsed independently. Missing files are silently skipped (no error). A non-nil Matcher is always returned even when no ignore files exist (it simply matches nothing).

func (*Matcher) IsIgnored

func (m *Matcher) IsIgnored(path string, isDir bool) bool

IsIgnored reports whether the given path should be ignored. path must be relative to the root directory that was passed to NewMatcher. isDir indicates whether the path refers to a directory. A nil Matcher always returns false.

Jump to

Keyboard shortcuts

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