Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIgnoreMatcher ¶ added in v0.3.1
func NewIgnoreMatcher(root string, opts ScanOptions) (func(relPath string) bool, error)
NewIgnoreMatcher returns a predicate reporting whether a project-relative path would be EXCLUDED by the active ignore rules — the same rules ScanDirOpts applies: .docgraphignore always, and .gitignore unless opts.NoGitignore, at the root and in every nested directory. It collects the ignore files once (a cheap walk that reads only ignore files, skipping the usual vendored/VCS dirs); the returned closure then classifies any number of paths.
This is the safe signal for the serve-time delete-reconcile: a file that is still on disk but now matches an ignore rule is unambiguously meant to be excluded, so pruning it is correct. That is strictly narrower than raw scan-set membership (which also drops too-big / unreadable / transiently-absent files) and so cannot mass-delete the index when a scan momentarily returns few or no files.
Types ¶
type FileEntry ¶
func ScanDirOpts ¶
func ScanDirOpts(root string, opts ScanOptions) ([]FileEntry, error)
type ScanOptions ¶
type ScanOptions struct {
NoGitignore bool
}