Skip to content

Restrict characters in tag extensions per issue #1471 - #1497

Merged
VisLab merged 2 commits into
hed-standard:mainfrom
VisLab:address_issues
Nov 8, 2026
Merged

VisLab merged 2 commits into
hed-standard:mainfrom
VisLab:address_issues

Conversation

@VisLab

@VisLab VisLab commented Nov 8, 2026

Copy link
Copy Markdown
Member

No description provided.

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.
@VisLab
VisLab requested a balanced review from Copilot November 8, 2026 19:32
@VisLab VisLab added bug Something isn't working enhancement New feature or request testing required-update labels Nov 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 name characters, reporting violations as TAG_EXTENSION_INVALID while 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

@VisLab
VisLab merged commit c3309d2 into hed-standard:main Nov 8, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request required-update testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants