ignore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIgnorePatterns = []string{

	".git",
	".svn",
	".hg",

	"node_modules",
	"vendor",
	"bower_components",
	".npm",
	".yarn",
	".pnp.*",

	"dist",
	"build",
	"out",
	"target",
	"bin",
	"obj",

	".idea",
	".vscode",
	".vs",
	"*.swp",
	"*.swo",
	"*~",

	".DS_Store",
	"Thumbs.db",
	"desktop.ini",

	"__pycache__",
	"*.pyc",
	"*.pyo",
	".venv",
	"venv",
	".env",

	"*.exe",
	"*.dll",
	"*.so",
	"*.dylib",
	"*.o",
	"*.a",
	"*.lib",
	"*.class",
	"*.jar",
	"*.war",

	"*.zip",
	"*.tar",
	"*.tar.gz",
	"*.tgz",
	"*.rar",
	"*.7z",

	"*.png",
	"*.jpg",
	"*.jpeg",
	"*.gif",
	"*.bmp",
	"*.ico",
	"*.webp",
	"*.tiff",

	"*.woff",
	"*.woff2",
	"*.ttf",
	"*.eot",
	"*.otf",

	"*.mp3",
	"*.mp4",
	"*.avi",
	"*.mov",
	"*.wav",
	"*.flac",

	"*.pdf",
	"*.doc",
	"*.docx",
	"*.xls",
	"*.xlsx",
	"*.ppt",
	"*.pptx",

	"*.min.js",
	"*.min.css",

	"package-lock.json",
	"yarn.lock",
	"pnpm-lock.yaml",
	"Gemfile.lock",
	"poetry.lock",
	"Cargo.lock",
	"go.sum",
	"composer.lock",

	"*.map",

	"coverage",
	".nyc_output",
	"htmlcov",

	".cache",
	".parcel-cache",
	".next",
	".nuxt",

	"*.log",

	"*.sqlite",
	"*.sqlite3",
	"*.db",
}

DefaultIgnorePatterns contains patterns that should always be ignored during indexing. These are common directories and files that are never useful for code search.

Functions

This section is empty.

Types

type Matcher

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

Matcher determines whether a file path should be ignored during indexing. It combines default patterns, .gitignore rules, .claudeignore rules, and custom CLI patterns. Thread-safe: Reload() acquires a write lock, ShouldIgnore()/ShouldIgnoreDir() acquire a read lock.

func NewMatcher

func NewMatcher(options MatcherOptions) *Matcher

NewMatcher creates an ignore matcher that checks default patterns, .gitignore, .claudeignore, and custom patterns.

func (*Matcher) IsFileTooLarge

func (m *Matcher) IsFileTooLarge(fileSize int64) bool

IsFileTooLarge returns true if the file exceeds the max file size limit.

func (*Matcher) MaxFileSizeBytes

func (m *Matcher) MaxFileSizeBytes() int64

MaxFileSizeBytes returns the configured maximum file size.

func (*Matcher) Reload

func (m *Matcher) Reload()

Reload re-reads .gitignore and .claudeignore files from disk. Used when the watcher detects changes to these files.

func (*Matcher) ShouldIgnore

func (m *Matcher) ShouldIgnore(absolutePath string) bool

ShouldIgnore returns true if the given path should be excluded from indexing. The path should be an absolute path or relative to the root directory.

func (*Matcher) ShouldIgnoreDir

func (m *Matcher) ShouldIgnoreDir(absolutePath string) bool

ShouldIgnoreDir returns true if a directory should be skipped entirely during traversal.

type MatcherOptions

type MatcherOptions struct {
	RootDir              string
	CustomPatterns       []string
	ForceIncludePatterns []string
	MaxFileSizeBytes     int64
}

MatcherOptions configures the ignore matcher.

Jump to

Keyboard shortcuts

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