ignore

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 7 Imported by: 1 module, 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

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