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

Function loadIgnore

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

Source from the content-addressed store, hash-verified

2000 }
2001
2002 const loadIgnore = (dir: string): ScopedIgnore | null => {
2003 const giPath = path.join(dir, '.gitignore');
2004 if (!fs.existsSync(giPath)) return null;
2005 // readGitignorePatterns is defensive: a non-UTF-8 (DLP-encrypted) or
2006 // uncompilable .gitignore is skipped/filtered with a warning, never thrown
2007 // (issue #682) — so the per-file `.ignores()` calls below can't crash.
2008 const patterns = readGitignorePatterns(giPath);
2009 return patterns ? { dir, ig: ignore().add(patterns) } : null;
2010 };
2011
2012 const isIgnored = (fullPath: string, isDir: boolean, matchers: ScopedIgnore[]): boolean => {
2013 for (const { dir, ig } of matchers) {

Callers 1

walkFunction · 0.85

Calls 3

readGitignorePatternsFunction · 0.85
joinMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected