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

Function buildDefaultIgnore

src/extraction/index.ts:652–667  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

650 * opt-in).
651 */
652export function buildDefaultIgnore(rootDir: string): Ignore {
653 const ig = ignore().add(DEFAULT_IGNORE_PATTERNS);
654 const projectRules = ignore();
655 const rootGitignore = path.join(rootDir, '.gitignore');
656 if (fs.existsSync(rootGitignore)) {
657 const patterns = readGitignorePatterns(rootGitignore);
658 ig.add(patterns);
659 projectRules.add(patterns);
660 }
661 const extra = readGitExcludeExtraPatterns(rootDir);
662 if (extra) {
663 ig.add(extra);
664 projectRules.add(extra);
665 }
666 return excludeBuildOutputUnderSrc(ig, projectRules);
667}
668
669/**
670 * Defaults-only ignore matcher (no root `.gitignore` merged). Used wherever the

Callers 7

extraction.test.tsFile · 0.90
buildScopeIgnoreFunction · 0.85
visitFunction · 0.85
collectGitFilesFunction · 0.85
collectGitStatusFunction · 0.85
scanDirectoryWalkFunction · 0.85

Calls 5

readGitignorePatternsFunction · 0.85
addMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected