Add warning for unmatched include/exclude patterns#55
Merged
simone-viozzi merged 4 commits intomainfrom Nov 23, 2025
Merged
Conversation
- Modified FilterEngine to track which patterns have matched at least once - Added get_unmatched_patterns() method to retrieve patterns that didn't match - Updated main() to display warnings to stderr for unmatched patterns - Added comprehensive tests for the new functionality - All existing tests pass Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
- Remove unreachable code in filter.py - Clarify misleading comment in test_unmatched_patterns.py Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add warning for unmatched inclusion exclusion patterns
Add warning for unmatched include/exclude patterns
Nov 23, 2025
simone-viozzi
requested changes
Nov 23, 2025
Owner
simone-viozzi
left a comment
There was a problem hiding this comment.
instead of adding 5 new tests, extend some of the existing ones
Instead of creating a standalone test file with 7 new tests, extended existing test files: - Added 2 FilterEngine unit tests to test_file_filtering.py - Added 2 CLI warning tests to test_user_issue_exclusion.py - Added 1 CLI warning test to test_filter_spec.py - Removed standalone test_unmatched_patterns.py Total: 63 tests (down from 65, as 5 new tests integrated into existing files) Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
Contributor
Author
Done. I've integrated the tests into existing test files:
Total test count is now 63 (down from 65, as 5 new tests were integrated into existing files). All tests pass. (commit 861b730) |
simone-viozzi
approved these changes
Nov 23, 2025
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.
Implement warning for unmatched include/exclude patterns
The goal is to raise a warning to stderr when some patterns did not match anything.
Plan:
Implementation Details:
Changes to
filter.py:_pattern_matcheddictionary to track whether each pattern has matched at least oncematches()method to set the tracking flag when a pattern matchesget_unmatched_patterns()method to return list of unmatched patterns with their rule kinds_include_can_match_descendant()Changes to
gpt_copy.py:--include 'pattern'or--exclude 'pattern'for each unmatched patternTest changes:
test_file_filtering.pywith 2 FilterEngine unit tests for tracking mechanismtest_user_issue_exclusion.pywith 2 CLI tests for warningstest_filter_spec.pywith 1 CLI test for warnings in complex scenariosTesting:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.