Skip to content

FIX: Improve errors for duplicate tags (issue #738)#739

Merged
VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_actions
May 22, 2026
Merged

FIX: Improve errors for duplicate tags (issue #738)#739
VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_actions

Conversation

@VisLab
Copy link
Copy Markdown
Member

@VisLab VisLab commented May 22, 2026

The duplicate tag errors were not reporting where the error occurred (e.g., line numbers in tsv and key values in json), only the file in which they occurred and what tags were duplicated.

@github-actions
Copy link
Copy Markdown

Claude code review could not run. The request to the Claude API failed (possible causes: billing limit reached, token expired, or service unavailable). Review this PR manually.

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 improves duplicate-tag error reporting by ensuring duplicate-tag detection failures are returned as regular Issue objects (instead of thrown exceptions), so BIDS validators can attach context like TSV line numbers and sidecar key/file information.

Changes:

  • Catch IssueError thrown during ParsedHedString normalization (e.g., duplicateTag) and return it via the parser’s standard [parsedString, errors, warnings] contract.
  • Update BIDS JSON-driven tests to assert duplicateTag issues include tsvLine and/or sidecarKey/filePath, and add targeted regression cases.
  • Adjust normalizer test expectations to align with the new non-throwing behavior (normalized output becomes undefined when parsing returns null).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/jsonTestData/normalizerTests.data.js Updates expected normalized output for duplicate-tag failures to match the parser’s new return behavior.
tests/jsonTestData/bidsTests.data.js Adds/updates expected BIDS-wrapped issues so duplicate-tag errors include TSV line numbers and sidecar key/file context; adds regression tests.
src/parser/parser.js Converts IssueError from normalized-form computation into returned parse issues so downstream callers can enrich them with BIDS context.

@VisLab VisLab changed the title FIX: Improved the error reporting on duplicate tags FIX: Improve errors for duplicate tags (issue #738) May 22, 2026
@VisLab VisLab merged commit f6765df into hed-standard:main May 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants