Start revising the schema compliance checking#1232
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR begins a refactor of HED schema compliance checking by moving to a more data-driven validator (domain/range-based) and adding a structured compliance reporting summary, with corresponding test updates and small supporting script/config changes.
Changes:
- Reworked
hed/schema/schema_compliance.pyto build attribute validators from schema metadata (domain/range) and to attach aComplianceSummaryto the returned issues list. - Added
hed/schema/schema_compliance_summary.py(new) plus additional tests validating summary output and domain/range invariants. - Updated multiple tests to account for new/expanded compliance checks and adjusted schema loading checks output shape.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/schema/test_schema_wiki_fatal_errors.py | Updates expected issue count for fatal error test. |
| tests/schema/test_schema_format_roundtrip.py | Makes duplicate tests assert by error code rather than total issue count. |
| tests/schema/test_schema_compliance.py | Adds extensive tests for ComplianceSummary and domain/range constraints; updates schema versions under test. |
| tests/schema/test_schema_attribute_validators.py | Updates deprecatedFrom edge cases (current version allowed; future invalid). |
| tests/schema/test_hed_schema_io.py | Adjusts expected compliance issue counts and assertions to tolerate additional issue types. |
| tests/schema/test_hed_schema_group.py | Updates expected warning count for group compliance. |
| tests/schema/test_hed_schema.py | Updates expected warning count for group compliance. |
| spec_tests/test_errors.py | Alters spec test runner behavior for schema_tests (currently disables running them). |
| hed/scripts/check_schema_loading.py | Removes “skipped” from results/summary and updates docstring accordingly. |
| hed/schema/schema_compliance_summary.py | New: compliance reporting structure and text report output. |
| hed/schema/schema_compliance_old.py | New: keeps prior compliance implementation (now with summary support). |
| hed/schema/schema_compliance.py | Main refactor: new domain/range constants, validator building, and summary attachment. |
| hed/schema/schema_attribute_validators.py | Updates deprecatedFrom validation to allow current (even prerelease) schema version. |
| hed/schema/hed_schema_entry.py | Ensures subclasses call super().finalize_entry(schema) to clear stale unknown attributes. |
| .github/dependabot.yml | Fixes GitHub Actions dependabot directory to /. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.