feat: add .gitignore pattern support for repository analysis#35
Open
e2720pjk wants to merge 2 commits intoFSoft-AI4Code:mainfrom
Open
feat: add .gitignore pattern support for repository analysis#35e2720pjk wants to merge 2 commits intoFSoft-AI4Code:mainfrom
e2720pjk wants to merge 2 commits intoFSoft-AI4Code:mainfrom
Conversation
- Implement hybrid .gitignore processing using git check-ignore with pathspec fallback - Add --respect-gitignore CLI option to both config and generate commands - Update configuration models to store gitignore preference persistently - Enhance RepoAnalyzer with gitignore pattern matching and priority logic - Add comprehensive test suite for gitignore verification including negation patterns - Update documentation with detailed pattern behavior and processing logic - Add pathspec dependency for robust gitignore pattern matching The feature respects .gitignore patterns during file analysis while maintaining proper priority: 1. Git ignore patterns are checked first 2. User CLI exclude patterns override git tracking 3. Default ignore patterns are applied last 4. Include patterns filter the remaining files
3d79fef to
93a610e
Compare
…option - Remove early return in repo_analyzer to allow default ignore patterns to be checked - Add respect_gitignore parameter to DependencyParser constructor for configurable gitignore handling - Update DependencyGraphBuilder to pass respect_gitignore configuration to parser - Enhance test coverage to verify gitignore behavior when both enabled and disabled - Modify test patterns to avoid conflicts with default ignore patterns for more accurate testing
c5643e7 to
cbc64bd
Compare
michaelassraf
added a commit
to flamingo-stack/CodeWiki
that referenced
this pull request
Jan 30, 2026
RESEARCH-BASED ENHANCEMENT: Researched official Mermaid documentation (mermaid.js.org) and LLM best practices to create bulletproof syntax rules. Key additions based on official docs: 1. Diagram declaration requirement (flowchart TD/LR) 2. Reserved keyword 'end' must be capitalized 3. Node IDs starting with 'o' or 'x' create circle/cross edges 4. HTML entity escaping (&FSoft-AI4Code#35; for #, & for &) 5. Subgraph direction syntax 6. Comment syntax with %% (avoid braces) 7. Comprehensive special character list 8. Validation checklist before generation Enhanced edge label rules: - Always quote ALL special characters: @ () [] {} <> & | # $ % - No spaces before/after pipes in labels - Examples for every special character type Complete working example included and tested. Sources: - https://mermaid.js.org/intro/syntax-reference.html - https://mermaid.js.org/syntax/flowchart.html - https://microsoft.github.io/genaiscript/blog/mermaids/ - https://docsbot.ai/prompts/technical/fix-mermaid-graph-parse-error Result: AI will generate 100% valid Mermaid syntax
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.
This PR splits out a feature from the fork branch referenced in #28 as an initial contribution🙏
Welcome to review and provide suggestions. I'm happy to make adjustments as needed
PR report(from DeepWiki team): https://app.devin.ai/review/FSoft-AI4Code/CodeWiki/pull/35
TLDR
Adds support for respecting
.gitignorepatterns during repository analysis. Usesgit check-ignorewhen available with fallback to pathspec library.Examples:
Dive Deeper
Key Changes
repo_analyzer.py
_user_exclude_patternsto distinguish user-specified vs default excludesrespect_gitignore:_should_include_fileto use pathspec matching for include patternsanalysis_service.py
Nonechecks inanalyze_local_repositoryand_analyze_structureHow It Works
git check-ignorecommand for full recursive accuracy.gitignorematching.gitignorefiles, pattern negation (!pattern), and complex patterns.git,*.pyc,__pycache__/,node_modules/, etc.Exclusion priority:
--respect-gitignoreenabled and git says ignored) → exclude--exclude) → exclude.gitignorefile (if--respect-gitignoreenabled) → excludeUse cases:
node_modules/,build/,.env,*.log__pycache__/,*.pyc,.venv/,*.egg-info/.gitignorefile are respected.git/), caches, logs, and other standard patterns always excludedReviewer Test Plan Suggestions
1. Check Documentation
You can review the changes in
README.mdto verify accuracy and clarity:2. Verify Gitignore Behavior
You can run this script to verify hybrid strategy and priority logic:
The test script verifies:
Output:
Details
3. Runtime Check
You can verify the CLI configuration loads the flag correctly:
Output:
Details