fix: extend default ignore patterns and fix nested path matching#92
Open
E-ChintanGohil wants to merge 1 commit intotirth8205:mainfrom
Open
fix: extend default ignore patterns and fix nested path matching#92E-ChintanGohil wants to merge 1 commit intotirth8205:mainfrom
E-ChintanGohil wants to merge 1 commit intotirth8205:mainfrom
Conversation
The `_should_ignore` function only used `fnmatch.fnmatch()` which matches from the start of the path. This means nested dependency directories like `packages/app/node_modules/react/index.js` were NOT ignored — only top-level `node_modules/` was caught. This is a problem in monorepos, workspaces, and any project with nested dependency directories. The graph would parse thousands of third-party files, inflating build time and polluting blast radius queries. Fix: check if any path segment matches the pattern prefix (e.g., if "node_modules" appears anywhere in the path parts). Also extends DEFAULT_IGNORE_PATTERNS to cover common frameworks: - PHP/Laravel: vendor/, storage/, bootstrap/cache/, public/build/ - Ruby/Rails: vendor/bundle/, .bundle/ - Java/Kotlin: .gradle/, *.jar - .NET/C#: bin/, obj/, packages/ - Dart/Flutter: .dart_tool/, .pub-cache/ - General: coverage/, .cache/, tmp/, .nuxt/
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.
Summary
_should_ignoreto handle nested dependency directories (e.g.,packages/app/node_modules/) by checking path segments, not just prefix matchingDEFAULT_IGNORE_PATTERNSwith common framework patterns: PHP/Laravel (vendor/,storage/), Ruby/Rails, Java/Gradle, .NET, Dart/Flutter, and general (coverage/,.cache/,tmp/)Closes #91
Changes
code_review_graph/incremental.py: Updated_should_ignorewithPurePosixPath.partssegment matching + added 15 new default patternstests/test_incremental.py: Addedtest_should_ignore_nested_pathsandtest_should_ignore_framework_patternsTest plan
src/,app/) confirmed not affected by new patterns