Documentation
¶
Index ¶
- func CollectFiles(paths []string, shouldIgnore func(path string) bool) ([]string, error)
- func CollectFilesFromTree(node *TreeNode, basePath string, files *[]string)
- func ListDirectory(path string, shouldIgnore func(string) bool) ([]string, error)
- func Matches(path string, patterns []string) (bool, error)
- type TreeNode
- type VCSMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectFiles ¶ added in v1.9.30
CollectFiles recursively collects all files from given paths. Supports glob patterns (via doublestar), directories, and individual files. Skips paths that don't exist instead of returning an error. Optional shouldIgnore filter can exclude files/directories (return true to skip).
func CollectFilesFromTree ¶ added in v1.9.30
CollectFilesFromTree recursively collects file paths from a DirectoryTree. Pass basePath="" for relative paths, or a parent directory for absolute paths.
func ListDirectory ¶
Types ¶
type TreeNode ¶
type VCSMatcher ¶ added in v1.9.14
type VCSMatcher struct {
// contains filtered or unexported fields
}
VCSMatcher handles VCS ignore pattern matching for a git repository
func NewVCSMatcher ¶ added in v1.9.14
func NewVCSMatcher(basePath string) (*VCSMatcher, error)
NewVCSMatcher creates a new VCS matcher for the given path. It searches for a git repository and loads .gitignore patterns. Returns (nil, nil) if no git repository is found - this is not an error. Results are cached by repository root path to avoid repeated parsing.
func (*VCSMatcher) RepoRoot ¶ added in v1.9.14
func (m *VCSMatcher) RepoRoot() string
RepoRoot returns the repository root path for this matcher
func (*VCSMatcher) ShouldIgnore ¶ added in v1.9.14
func (m *VCSMatcher) ShouldIgnore(path string) bool
ShouldIgnore checks if a path should be ignored based on VCS rules. It checks both .git directories and .gitignore patterns.