Skip to content

Never let verify --json fail without a diagnostic#27

Merged
cgraf78 merged 1 commit into
mainfrom
verify-json-fallback
Jul 1, 2026
Merged

Never let verify --json fail without a diagnostic#27
cgraf78 merged 1 commit into
mainfrom
verify-json-fallback

Conversation

@cgraf78

@cgraf78 cgraf78 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

_run_project_tool only synthesized a diagnostic when a non-zero verifier also wrote to stderr, so a tool that exited non-zero with unparsable stdout and empty stderr failed silently (failing rc, zero diagnostics, no reason).

Broaden the fallback to always surface one diagnostic for a non-zero run with no parsed diagnostics: prefer the last stderr line, then the last stdout line, then a generic "exited with status N and produced no diagnostics" message.

Testing: checkrun test suite passes (verify-test 107); new cases cover unparsable-stdout+empty-stderr and no-output-at-all; checkrun lint clean.

Summary
emit a synthetic diagnostic for any non-zero verifier run that produced
no parsable diagnostics, not just when stderr is non-empty.

`_run_project_tool` only synthesized a diagnostic when the tool exited
non-zero AND had no parsed diagnostics AND wrote to stderr. A verifier
that exited non-zero with unparsable stdout and empty stderr therefore
failed silently — a failing `rc` with zero diagnostics and no reason.
Broaden the fallback to always surface one diagnostic: prefer the last
stderr line, then the last stdout line, then a generic exit-status
message.

Testing
- checkrun test suite: all suites pass (verify-test 107 passed)
- new verify-test cases: non-zero exit with unparsable stdout + empty
  stderr yields a diagnostic from stdout; non-zero exit with no output
  yields a generic "exited with status N" diagnostic
- checkrun lint clean on both files
@cgraf78 cgraf78 merged commit da2a72b into main Jul 1, 2026
6 checks passed
@cgraf78 cgraf78 deleted the verify-json-fallback branch July 1, 2026 12:51
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.

1 participant