Skip to content

Fix multi-line TAP failure messages truncated by over-eager trimws()#20

Merged
smasongarrison merged 4 commits intomainfrom
copilot/sub-pr-19
Mar 23, 2026
Merged

Fix multi-line TAP failure messages truncated by over-eager trimws()#20
smasongarrison merged 4 commits intomainfrom
copilot/sub-pr-19

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

  • Understand the issue: trimws() in the TAP parsing loop strips leading whitespace from msg_lines, making the continuation-line detection grepl('^ ', ...) dead code
  • Fix: preserve original indentation in msg_lines, update pattern matching to handle indented lines, use indentation-depth comparison for continuation detection
  • Strip YAML block/folded scalar indicators (|-, |, >-, >) when they are the entire value after message:
  • Skip empty continuation lines (matches main branch behavior)
  • Verified: output matches main branch for all cases (block scalar with info, inline, empty lines, nested data, no message key); additionally handles >- folded scalars correctly where main did not
  • Code review and security scan (0 alerts)

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

…messages

- Store tap_lines without trimws() so indentation is retained
- Update grep/sub patterns to match indented YAML message keys
- Strip YAML block/folded scalar indicators (|-, |, >-, >) when they
  are the entire value after message:
- Replace fixed '^  ' continuation check with dynamic indentation-depth
  comparison so continuation lines (deeper indent than message: key)
  are correctly collected while sibling keys like severity: are excluded

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DataScience4Psych/actions/sessions/71658e60-8cda-4f29-bf56-aa97015ea3ec
Copilot AI changed the title [WIP] Revert fix info parameter not appearing in autograding failure messages Fix multi-line TAP failure messages truncated by over-eager trimws() Mar 23, 2026
Copilot AI requested a review from smasongarrison March 23, 2026 20:36
@smasongarrison smasongarrison marked this pull request as ready for review March 23, 2026 21:14
@smasongarrison smasongarrison changed the base branch from revert-18-copilot/add-info-to-unit-test-feedback to main March 23, 2026 21:16
@smasongarrison
Copy link
Copy Markdown
Member

@copilot are you sure that this fixes the main branch?

Skip empty continuation lines (matching main branch behavior) and use
a unified content-first-then-append pattern for both block scalars
and inline messages. This makes the implementation produce identical
output to main for all |- block scalar cases, while also correctly
handling >- folded scalars (which main did not recognize).

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DataScience4Psych/actions/sessions/c6fdd31e-b2c5-4ce2-acf4-815d4505d692
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 23, 2026

@copilot are you sure that this fixes the main branch?

Yes, confirmed. I compared the PR implementation against the main branch (8d7a9c2) across all relevant TAP output patterns, and they produce identical results for every case tested (block scalar |- with info, inline single-line, empty continuation lines, nested data blocks, missing message: key).

The net diff from main after this PR merges is a unified indentation-depth-based continuation parser that replaces the two-path (if (grepl('^\\|')) / else) logic. Behaviorally equivalent — with one improvement: >- folded scalar indicators are now also correctly stripped, whereas the original main code only handled | scalars.

Fixed in 688a105.

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