ignorefile

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShouldSkipFunc

func ShouldSkipFunc(root, filename string) (func(string) bool, error)

ShouldSkipFunc returns a function that reports whether a path should be skipped based on the ignore file found relative to root. If root is a file rather than a directory, its parent directory is used. The returned function accepts both absolute and relative paths; absolute paths are converted to relative paths before matching. If the ignore file does not exist, the returned function always returns false.

Types

type Patterns

type Patterns []string

Patterns holds a list of glob patterns parsed from an ignore file.

func Parse

func Parse(path string) (patterns Patterns, err error)

Parse reads an ignore file and returns the patterns. Returns nil and no error if the file does not exist.

func (Patterns) Matches

func (p Patterns) Matches(path string) bool

Matches reports whether the given path matches any pattern. It checks the full path and each directory prefix so that a pattern like "generator/test-*" matches "generator/test-foo/bar.templ".

Jump to

Keyboard shortcuts

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