Module: gitignore
Contents
Functionsparse_gitignore- Parse.gitignorefromrootand return a list of simple directory/fileshould_skip_path- Check whetherpathshould be skipped based on its directory components
resq_cli::gitignore::parse_gitignore
Function Parse.gitignore from root and return a list of simple directory/file
names to exclude during traversal.
Strategy (matches the TS parseGitignore in sync-turbo-env.ts):
- Read
.gitignore, split into lines - Strip comments (
#) and blank lines - Normalize: remove leading
/and trailing/ - Drop negations (
!) and wildcard patterns (*) — too complex for simple component-based matching; these are already handled by git itself - Always include
.gitandnode_modulesas safety nets
resq_cli::gitignore::should_skip_path
Function Check whetherpath should be skipped based on its directory components
matching any entry in excludes.