feat: zero-config indexing driven by .gitignore (#283)#285
Merged
Conversation
Remove .codegraph/config.json and the entire config surface. CodeGraph now indexes every file whose extension maps to a supported language and respects .gitignore everywhere — git repos via git itself, non-git projects via the `ignore` library (root + nested .gitignore files, the same way git does). - Remove CodeGraphConfig/DEFAULT_CONFIG, src/config.ts, and the public config API (the `config` option on init, getConfig/updateConfig/getConfigPath). - Derive the source-file allowlist from EXTENSION_MAP (isSourceFile); maxFileSize is now a constant. Drop the .codegraphignore marker. - Behavior change: committed, non-gitignored dirs (vendor/, a committed dist/) are now indexed — .gitignore is the single source of truth. Earlier inert fields (languages, frameworks, extractDocstrings, trackCallSites, customPatterns) and their dead helpers are removed as part of this. Resolves #283. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #283. The issue asked us to document the config — but investigating it showed the config was mostly inert or broken, so we removed it entirely and made CodeGraph zero-config.
CodeGraph now indexes every file whose extension maps to a supported language and respects
.gitignoreeverywhere:git ls-files --exclude-standard), already the casegit init) — by reading.gitignorefiles directly, root + nested, via theignorelibrary so negation/anchoring/nested rules behave exactly like gitThere's no config file to write or keep in sync.
Changes
.codegraph/config.jsonand the whole config surface. Every field was inert (languages,frameworks,extractDocstrings,trackCallSites,customPatternswere never consumed;languagesvalidation was also broken — it rejected every language added after the original 8) or now redundant with.gitignore.include→ derived fromEXTENSION_MAP(isSourceFile);exclude→.gitignore;maxFileSize→ a constant (1 MB).src/config.ts,CodeGraphConfig/DEFAULT_CONFIG, the dead helpers (addCustomPattern/addIncludePatterns/addExcludePatterns/isSafeRegex), and the.codegraphignoremarker.configoption onCodeGraph.init(),getConfig(),updateConfig(),getConfigPath, and theCodeGraphConfigtype are gone. Existingconfig.jsonfiles are simply ignored.Behavior change⚠️
Committed files that are not gitignored are now indexed even under
vendor/,Pods/, or a committeddist/— previously a hardcoded exclude list skipped those names..gitignoreis now the single source of truth. Documented in the README.Validation
npm run buildclean; 722/722 tests pass (config tests rewritten to cover the new.gitignore-based behavior, nested-.gitignorescoping, andisSourceFile)..gitignore→node_modules/distexcluded,srcindexed, noconfig.jsonwritten ✅.gitignore→ ignored dirs excluded via the new walk ✅node_modules→ indexed (documented tradeoff) ✅🤖 Generated with Claude Code