- Notifications
You must be signed in to change notification settings - Fork 33
Add filtering of issues by type/ID or by file location #1743
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #1743 +/- ## ========================================== + Coverage 75.08% 75.38% +0.30% ========================================== Files 84 85 +1 Lines 11874 12041 +167 ========================================== + Hits 8915 9077 +162 - Misses 2959 2964 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @yarikoptic Is it appropriate to add the |
4ceaf7f to 3d2c281 Compare 6f5d9e8 to 51a7e1c Compare To filter validation results by ID using regex patterns
This allows the return type to reflect the fact that the order of the elements in the return doesn't matter.
This option allows filtering of issues in the validation results to only those associated with the given path(s)
51a7e1c to 5cbceb7 Compare 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 adds two new filtering options to the dandi validate command to provide more granular control over validation results:
--match: Filters validation issues by ID using comma-separated regex patterns--include-path: Filters validation issues by their associated file paths
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
docs/source/cmdline/validate.rst | Documents the two new command-line options (--match and --include-path) |
dandi/utils.py | Implements filter_by_id_patterns() and filter_by_paths() helper functions with TYPE_CHECKING import for ValidationResult |
dandi/cli/base.py | Adds _compile_regex() and parse_regexes() callback for parsing comma-separated regex patterns |
dandi/cli/cmd_validate.py | Integrates new options into the validate command and applies filters in _process_issues() |
dandi/tests/test_utils.py | Comprehensive test coverage for both filter functions with various edge cases |
dandi/cli/tests/test_cmd_validate.py | Tests for CLI option parsing, validation, and interaction with existing options |
dandi/cli/tests/test_base.py | Tests for regex compilation and parsing utilities |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| callback=parse_regexes, | ||
| ) | ||
| @click.option( | ||
| "--include-path", |
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.
- name was a little confusing as I thought "include name in the result"
- we might want to simply (ab)use existing
pathsposarg as it is to define what paths we care about. So even if within bids dataset, bids-validator-deno would run on entire dataset ATM and then we need to filter for those paths- we should also warn about that -- that we do run bids-validator on the full dandiset although interested only in some
| ) | ||
| @click.option("--ignore", metavar="REGEX", help="Regex matching error IDs to ignore") | ||
| @click.option( | ||
| "--match", |
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.
--match suggests me to match as limiting some work... here we are talking only report filtering... I also wonder if we could join here to support various elements of an issue, not have them separate, so could be smth like
--report-matches=id:REGEX,path:.\*_events.* which should serve as AND so should match all of the above
| ), | ||
| ] | ||
| | ||
| @pytest.mark.parametrize( |
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.
these all look like AI generated... please instruct your agent to use @pytest.mark.ai_generated for such tests
yarikoptic left a comment
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.
I left comments in line, without compiling into this report. I will move into draft to avoid paying attention until the next round (take out of draft then)
This addresses checkpoint 2 of #1597. It adds two options to
dandi validatespecified in the "Release Notes" section below.TODO:
minororpatchlabel.Release Notes
The
dandi validatenow has two additional options--matchwhich takes in a list of comma-separated regex patterns to filter issues in validation results by their ID.--include-pathwhich takes in multiple paths to filter issues in the validation results to those associated with the paths.