Extract filesystem selector matching#382
Merged
autholykos merged 1 commit intomainfrom May 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Extracts filesystem source selector validation and recursive matching into a shared internal/pathselector package, then reuses that contract from both config validation and source selection explanation, while relocating low-level matcher tests into the new package.
Changes:
- Introduce
internal/pathselectorwithCompile/Validate/Matchand recursive**matching. - Route filesystem selector validation in config through
pathselector.Validate. - Update source explanation matching to use
pathselector.Matchand move relevant tests to the new package.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/source/filesystem_test.go | Removes selector/matcher unit tests that are now owned by internal/pathselector. |
| internal/source/explain.go | Switches selector matching to pathselector.Match and removes inlined matcher implementation. |
| internal/pathselector/pathselector.go | Adds the shared selector compiler/validator and recursive matcher. |
| internal/pathselector/pathselector_test.go | Adds unit tests for recursive matching and validation errors. |
| internal/config/config.go | Uses pathselector.Validate for filesystem source include/exclude pattern validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d992ddd to
e0b8d4a
Compare
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
Tests