Environment
- Margin 0.4.0
- macOS 26.2 (build 25C56)
- Apple silicon
- Package:
Margin-0.4.0-macOS-arm64.pkg
- Package SHA-256:
cb85c8f4bda5fa2c43fb775214d9ff5241d2143cf88d34088c3ea2dc975119a5
Summary
The comments validate help states that --pretty pretty-prints JSON output.
The command ignores this option when validation fails.
The failure JSON is compact and uses one line.
Reproduction steps
- Create
invalid.md with this content.
# Invalid fixture
<!-- margin:comments:v1
{ this is not valid JSON }
-->
- Run this command.
margin comments validate invalid.md --pretty
Actual behavior
The command exits with status 65.
It returns compact JSON on one line.
{"error":{"code":"INVALID_COMMENT_ENVELOPE","message":"The Margin comment envelope is invalid: The data couldn’t be read because it isn’t in the correct format."},"ok":false,"schema":"urn:margin:cli:v1"}
Expected behavior
The command must apply --pretty to success and error JSON.
The error code and exit status must remain unchanged.
Acceptance criteria
margin comments validate invalid.md --pretty emits indented JSON.
- The output ends with one line feed.
- The command keeps exit status 65.
- The command keeps error code
INVALID_COMMENT_ENVELOPE.
- Automated tests cover pretty-printed error output.
Environment
Margin-0.4.0-macOS-arm64.pkgcb85c8f4bda5fa2c43fb775214d9ff5241d2143cf88d34088c3ea2dc975119a5Summary
The
comments validatehelp states that--prettypretty-prints JSON output.The command ignores this option when validation fails.
The failure JSON is compact and uses one line.
Reproduction steps
invalid.mdwith this content.Actual behavior
The command exits with status 65.
It returns compact JSON on one line.
{"error":{"code":"INVALID_COMMENT_ENVELOPE","message":"The Margin comment envelope is invalid: The data couldn’t be read because it isn’t in the correct format."},"ok":false,"schema":"urn:margin:cli:v1"}Expected behavior
The command must apply
--prettyto success and error JSON.The error code and exit status must remain unchanged.
Acceptance criteria
margin comments validate invalid.md --prettyemits indented JSON.INVALID_COMMENT_ENVELOPE.