Skip to content

Report empty lines and wrong cell counts in tabular files - #978

Merged
VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_required
Nov 15, 2026
Merged

VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_required

Conversation

@VisLab

@VisLab VisLab commented Nov 15, 2026

Copy link
Copy Markdown
Member

Port hed-typescript's line rules (specification 3.2.10). The header is always line 1, so an empty first line is one blank column name. One line break at the end is not a line; any other empty line is TABULAR_INVALID (emptyTsvLine), and a line whose cell count differs from line 1 is TABULAR_INVALID (tsvCellCount). Row problems are reported by line after header problems and before the sidecar is checked. They are checked only on files that carry HED, including a HED cell in the first non-empty line.

Move the hed-tests pin to 0a07fe0; its 11 new TABULAR_INVALID cases pass.

Port hed-typescript's line rules (specification 3.2.10). The header is
always line 1, so an empty first line is one blank column name. One line
break at the end is not a line; any other empty line is TABULAR_INVALID
(emptyTsvLine), and a line whose cell count differs from line 1 is
TABULAR_INVALID (tsvCellCount). Row problems are reported by line after
header problems and before the sidecar is checked. They are checked only
on files that carry HED, including a HED cell in the first non-empty line.

Move the hed-tests pin to 0a07fe0; its 11 new TABULAR_INVALID cases pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@VisLab
VisLab requested a balanced review from Copilot November 15, 2026 15:30
@VisLab VisLab added enhancement New feature or request tests Issues related to testcases validation Tag validation issues issues BIDS and HED-specific issue data tasks required-update alignment Alignment between hed-javascript and hed-typescript. labels Nov 15, 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.

🟡 Changes recommended

Sidecar-construction errors still mask malformed-row diagnostics, violating the promised validation order and leaving the combined-error case without regression coverage.

1 open issue
What changed in this PR

This PR adds specification 3.2.10 line checks to the HED validator's tabular-file handling, aligning behavior with hed-typescript.

Changes:

  • Treat line 1 as the header and preserve empty data lines, excluding one final line break.
  • Report empty lines and mismatched cell counts in line order for files carrying HED.
  • Add regression tests, public diagnostic fields, and changelog documentation.
File Description
types/​index.d.ts Declares the new row diagnostic fields.
tests/​otherTests/​tsvParser.spec.js Tests line rules, diagnostic ordering, and HED detection.
src/​issues/​data.js Adds messages for empty lines and incorrect cell counts.
src/​bids/​validator/​tsvValidator.js Reports row problems before sidecar validation.
src/​bids/​types/​tsv.js Stores row diagnostics and detects HED after empty initial lines.
src/​bids/​tsvParser.js Preserves file lines and identifies row structure problems.
CHANGELOG.md Documents the updated tabular validation behavior.

Review effort: Balanced

Comment thread src/bids/types/tsv.js Resolved
@VisLab
VisLab merged commit 8d7fc42 into hed-standard:main Nov 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alignment Alignment between hed-javascript and hed-typescript. enhancement New feature or request issues BIDS and HED-specific issue data tasks required-update tests Issues related to testcases validation Tag validation issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants