fix(check): surface stale report on stderr when --silent fails#28
Merged
laulauland merged 2 commits intomainfrom Apr 21, 2026
Merged
fix(check): surface stale report on stderr when --silent fails#28laulauland merged 2 commits intomainfrom
laulauland merged 2 commits intomainfrom
Conversation
Previously --silent unconditionally routed stdout to a discarding writer, dropping the STALE lines and summary even on fail. Exit code was correct but the human-readable signal was gone, so CI and terminal users got no indication of what went stale. Split lint.run into compute/renderText/renderJson so the caller in main can decide where to render. In silent mode we skip stdout entirely on pass, and on fail we render the same report to stderr (text or json, matching --format). Non-silent behavior is unchanged.
The prior commit changed --silent behavior (report now goes to stderr on failure) but left the flag undocumented in docs/CLI.md and the affected bindings stale in drift.lock. Adds the CLI prose and refreshes the four stale sigs (main.zig for CLAUDE.md / DESIGN.md / SKILL.md, lint.zig for CLI.md).
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
drift check --silentpreviously discarded the stale/broken report entirely — even on failure. Exit code was correct (1) but terminal users and CI logs saw nothing explaining what went stale.With this change,
--silentstill suppresses output on a passing run, but on failure the same report (text or JSON, honoring--format) is written to stderr so the failure is observable. Non-silent behavior is unchanged.Implementation: split
lint.runintolint.compute+lint.renderText/lint.renderJson.main.zignow decides where to render based onsilentand the run status.CheckResultexposesstatus()andcheckedAny()helpers so the render functions don't need threaded booleans.Test plan
zig build— cleanzig build test— all greendrift check --silenton a stale repo → stderr has the report, stdout empty, exit 1drift check --silent 2>/dev/null→ no output, exit 1drift check --silent --format json→ JSON on stderr, stdout empty, exit 1drift check --silenton a passing run → no output, exit 0drift check(non-silent) regression — stdout unchanged