-
Notifications
You must be signed in to change notification settings - Fork 0
feat: gitignore pattern #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements enhanced ignore-pattern support by introducing gitignore-style matching, path normalization utilities, and updates to the file-linking logic, along with related documentation and tests.
- Adds platform-agnostic path normalization methods for display and pattern matching.
- Introduces a dynamic‐programming-based wildcard matcher and a gitignore‐style pattern matcher.
- Updates
FileLinkerService
to use the enhanced ignore logic and normalizes logged paths; adds and adapts tests and documentation accordingly.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/DotfilesLinker/Utilities/PathUtilities.cs | New NormalizePath and NormalizePathForPatternMatching methods |
src/DotfilesLinker/Services/WildcardMatcher.cs | Implements DP-based IsMatch for * and ? wildcards |
src/DotfilesLinker/Services/GitignoreMatcher.cs | Adds gitignore-style pattern parsing and matching |
src/DotfilesLinker/Services/FileLinkerService.cs | Replaces ignore logic with ShouldIgnoreFileEnhanced and normalizes logs |
src/DotfilesLinker.Tests/WildcardMatcherTests.cs | Tests for wildcard matching behavior |
src/DotfilesLinker.Tests/GitignoreMatcherTests.cs | Tests for gitignore-style matching |
src/DotfilesLinker.Tests/FileLinkerServicePatternTests.cs | Updates reflection helper to call enhanced ignore method |
README.md | Documents supported ignore-pattern types |
README_ja.md | Updates Japanese docs for ignore-pattern support |
.github/copilot-instructions.md | Tweaks workspace-specific instructions |
Comments suppressed due to low confidence (4)
src/DotfilesLinker.Tests/FileLinkerServicePatternTests.cs:123
- The helper method name InvokeShouldIgnoreFile is misleading after updating to call ShouldIgnoreFileEnhanced; consider renaming it to InvokeShouldIgnoreFileEnhanced for clarity.
private bool InvokeShouldIgnoreFile(string fileName, HashSet<string> userIgnorePatterns)
src/DotfilesLinker/Utilities/PathUtilities.cs:36
- There are no unit tests for NormalizePath and NormalizePathForPatternMatching methods; consider adding tests to verify these normalization behaviors across platforms.
internal static string NormalizePath(string path)
.github/copilot-instructions.md:1
- [nitpick] This line duplicates the previous instruction about communicating in Japanese; consider removing the redundant entry to avoid confusion.
- やり取りは日本語で行います。
src/DotfilesLinker/Services/FileLinkerService.cs:337
- [nitpick] ShouldIgnoreFileEnhanced is quite long and handles multiple pattern types; consider splitting into smaller, focused helper methods to improve readability and maintainability.
private bool ShouldIgnoreFileEnhanced(string filePath, string fileName, bool isDir, HashSet<string> userIgnorePatterns)
No description provided.