fix: cfg check-update prints human prose, not a JSON dump#23
Merged
Conversation
cfg check-update fell through _emit's generic dict path, which json.dumps() any unrecognized dict — so even in human mode (CFG_OUTPUT=human / interactive TTY) it printed raw JSON. Now the command formats its own output: the nudge message when behind, 'cfgit X is up to date' when current, a snooze/disabled line as appropriate; --json still emits the structured result. Tests: +2 (human prints a sentence not JSON; --json stays structured). 157 pass.
AusafMo
added a commit
that referenced
this pull request
Jul 26, 2026
Patch: cfg check-update renders human prose instead of a JSON dump (#23). Bug fix only, no new features. Both build + twine check clean. Co-authored-by: AusafMo <AusafMo@users.noreply.github.com>
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.
cfg check-update(and--snooze) printed raw JSON even in human/interactive mode — reported from a real terminal whereCFG_OUTPUT=human cfg check-updatestill emitted{...}.Cause: the command's result dict had no special keys, so
_emitfell through to_format_item, whichjson.dumps()es any unrecognized dict. "Human output" for this command was therefore a JSON dump.Fix:
check-updatenow formats its own output — the nudge message when behind,cfgit X is up to datewhen current, and clear snooze/disabled lines — while--jsonkeeps the structured result.Tests: +2 regression tests (human = sentence not JSON;
--json= structured). 157 pass, ruff clean.