Uncheck files from .gitignore by default#2
Merged
HichemTab-tech merged 2 commits intomasterfrom May 3, 2025
Merged
Conversation
Enhanced the `buildTreeNode` function to account for `.gitignore` patterns when generating directory trees. This ensures files and directories that match gitignore rules are excluded or marked as unchecked. - Added `collectDirectoryGitignorePatterns` and `shouldExcludeByGitignore` utility functions. - Updated `buildTreeNode` to handle gitignore patterns and pass them recursively. - Adjusted logic to mark files/folders as unchecked if excluded by gitignore rules.
Introduce unit and integration tests to validate gitignore utility functions, ensuring proper parsing, matching, and exclusion logic. These tests improve code reliability and prevent regressions. - Added tests for `parseGitignoreContent` to verify pattern parsing. - Tested `matchesGitignorePatterns` to validate inclusion/exclusion logic. - Implemented integration tests to check filesystem interactions. - Verified `collectGitignorePatterns` and `shouldExcludeByGitignore` behaviors. - Confirmed `buildTreeNode` respects gitignore patterns accurately.
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.
Description
This pull request introduces support for
.gitignorepatterns to the directory tree-building process. Files and directories that match gitignore rules are now excluded or marked as unchecked.Comprehensive tests for gitignore handling have also been added, ensuring robust pattern parsing, inclusion/exclusion logic, and filesystem integration. These tests improve reliability and prevent regressions by covering utility functions like
parseGitignoreContent,matchesGitignorePatterns, and the updatedbuildTreeNodefunction.Checklist