Repository navigation
Restrict characters in tag extensions per issue #1471 - #1497
Merged
Merged
Conversation
Specification 3.2.5 rule 2: an extension term contains only name characters. hedtools also accepted period, plus, caret, blank and colon (Item/my.ext passed with only TAG_EXTENDED). Fixes hed-standard#1471. - char_util: EXTENSION_SETS is now name plus forward slash. A character outside it is TAG_EXTENSION_INVALID (Appendix B reason b) instead of CHARACTER_INVALID, naming the character and its position. # is skipped there, since check_for_placeholder reports it as PLACEHOLDER_INVALID. - Tests: a new test for the five characters and $; Clock-face/08:30 under pre-8.3.0 schemas and a comma in a column-prefix extension now expect TAG_EXTENSION_INVALID; two sidecar fixtures use Action/Button-press instead of Action/Button press. - CHANGELOG: Unreleased entry.
Brings in the hed-standard#1471 cases (hed-tests PR hed-standard#97: period, plus, caret, blank and colon in an extension fail tag-extension-invalid-bad-node-name) and the DEF_INVALID cases of hed-tests PR hed-standard#96.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the extension-character validation changes.
No open issues 🎉
What changed in this PR
This PR tightens HED tag-extension validation to enforce the specification's character restrictions, addressing issue #1471.
Changes:
- Restrict extension terms to
namecharacters, reporting violations asTAG_EXTENSION_INVALIDwhile preserving separate#placeholder handling. - Add character-level regression tests and update existing validation expectations and sidecar fixtures.
- Document the compatibility change in the changelog.
| File | Description |
|---|---|
tests/validator/test_tag_validator.py |
Add extension-character tests and update colon-error expectations. |
tests/validator/test_tag_validator_library.py |
Update library validation expectations for invalid extension colons. |
tests/validator/test_staged_validation.py |
Expect the extension-specific error code. |
tests/data/sidecar_tests/both_types_events_without_definitions.json |
Replace a space in an extension with a hyphen. |
tests/data/sidecar_tests/both_types_events_with_defs.json |
Apply the same valid extension spelling. |
hed/validator/util/char_util.py |
Enforce allowed extension characters and retain separate placeholder checks. |
CHANGELOG.md |
Explain stricter validation and changed error reporting. |
Review effort: Balanced
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.