Skip to content

fix: cfg check-update prints human prose, not a JSON dump#23

Merged
AusafMo merged 1 commit into
mainfrom
fix/check-update-human-output
Jul 26, 2026
Merged

fix: cfg check-update prints human prose, not a JSON dump#23
AusafMo merged 1 commit into
mainfrom
fix/check-update-human-output

Conversation

@AusafMo

@AusafMo AusafMo commented Jul 26, 2026

Copy link
Copy Markdown
Owner

cfg check-update (and --snooze) printed raw JSON even in human/interactive mode — reported from a real terminal where CFG_OUTPUT=human cfg check-update still emitted {...}.

Cause: the command's result dict had no special keys, so _emit fell through to _format_item, which json.dumps()es any unrecognized dict. "Human output" for this command was therefore a JSON dump.

Fix: check-update now formats its own output — the nudge message when behind, cfgit X is up to date when current, and clear snooze/disabled lines — while --json keeps the structured result.

Tests: +2 regression tests (human = sentence not JSON; --json = structured). 157 pass, ruff clean.

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
AusafMo merged commit 96164d0 into main Jul 26, 2026
2 checks passed
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>
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