MCPcopy
hub / github.com/colbymchenry/codegraph / loadIgnore

Function loadIgnore

src/extraction/index.ts:1008–1016  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

1006 }
1007
1008 const loadIgnore = (dir: string): ScopedIgnore | null => {
1009 const giPath = path.join(dir, '.gitignore');
1010 if (!fs.existsSync(giPath)) return null;
1011 // readGitignorePatterns is defensive: a non-UTF-8 (DLP-encrypted) or
1012 // uncompilable .gitignore is skipped/filtered with a warning, never thrown
1013 // (issue #682) — so the per-file `.ignores()` calls below can't crash.
1014 const patterns = readGitignorePatterns(giPath);
1015 return patterns ? { dir, ig: ignore().add(patterns) } : null;
1016 };
1017
1018 const isIgnored = (fullPath: string, isDir: boolean, matchers: ScopedIgnore[]): boolean => {
1019 for (const { dir, ig } of matchers) {

Callers 1

walkFunction · 0.85

Calls 2

readGitignorePatternsFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected