MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / loadIgnore

Function loadIgnore

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

Source from the content-addressed store, hash-verified

1265 }
1266
1267 const loadIgnore = (dir: string): ScopedIgnore | null => {
1268 const giPath = path.join(dir, '.gitignore');
1269 if (!fs.existsSync(giPath)) return null;
1270 // readGitignorePatterns is defensive: a non-UTF-8 (DLP-encrypted) or
1271 // uncompilable .gitignore is skipped/filtered with a warning, never thrown
1272 // (issue #682) — so the per-file `.ignores()` calls below can't crash.
1273 const patterns = readGitignorePatterns(giPath);
1274 return patterns ? { dir, ig: ignore().add(patterns) } : null;
1275 };
1276
1277 const isIgnored = (fullPath: string, isDir: boolean, matchers: ScopedIgnore[]): boolean => {
1278 for (const { dir, ig } of matchers) {

Callers 1

walkFunction · 0.85

Calls 2

readGitignorePatternsFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected