Repository navigation
Conversation
Markdoc reports structural errors (undefined tags, unclosed blocks) with level 'critical'. The validate route only counted 'error' and 'warning', so a page with a critical error returned valid: true and `evidence validate` exited 0, even though the CLI's human report and `serve` both treat these as errors. Fixes evidence-dev#3340 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@tojacob03 is attempting to deploy a commit to the Evidence Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
/upstream |
Contributor
|
Imported for internal review, this PR will be updated when it merges. |
Member
|
Thanks for the contribution, @tojacob03! Merged upstream, and synced back in 80a719c |
Author
|
Thanks for the quick review and merge, @hughess ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
evidence validatereturnedvalid: trueand exited0when a page had a critical Markdoc error, such as an undefined tag.Markdoc gives structural errors (
tag-undefined,missing-opening,tag-placement-invalid, …) the levelcritical. The validate route only countederrorandwarning, so these errors were counted as neither.cli/cli/validate.tsalready printscriticalentries as errors, andserveshows them as a page-level error box. This change makes the JSON counts and the exit code agree with both.Fixes #3340
Changes
cli/src/routes/api/validate/+server.ts: countcriticalas an error.validate-route.test.tsnext to the route. It runsGETagainst a temporary project in syntax-only mode, the same wayhome-page-load.test.tsdoes, and checks:valid: true{% unknown_tag /%}giveserrorCount: 1andvalid: falseTesting
main(errorCountis0) and passes with the fix.cliVitest suite: 389/389 passed.svelte-checkoncli: the only error is the missingdocs-bundle.generatedmodule, which is created by the bun build step. It is not related to this change.