TODO follow-ups: corrupt-file backup, list JSON, reset confirmation, command-flow tests#2
Merged
Merged
Conversation
When a settings file fails to parse, SettingsStore.Load() surfaced the
error and returned defaults — but the next write would then overwrite the
unreadable file, destroying any recoverable content. Copy it to a
"{file}.bak" sidecar (best-effort) before defaults take over. The
original is copied, not moved, so a backup failure loses nothing.
Adds a test: a malformed file falls back to defaults, surfaces the
JsonException, and leaves a .bak with the original content. Suite 22 -> 23.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`settings list` printed bare type names (e.g. "MyApp.Profile", "System.Collections.Generic.List`1[...]") for any non-scalar property. FormatValue now serialises complex/collection values as compact JSON so the table stays informative; scalars are unchanged. Also resolves the get/set TODO item: decided against it. The library favours flat scalar settings, so a single-property CLI getter/setter added conversion/complex-type surface without enough payoff. Documented the nested-value caveats (in-place mutation isn't auto-saved) and a "prefer scalars" recommendation in the README, and recorded the get/set decision in TODO. Adds 4 FormatValue tests (scalar string, bool, nested object -> JSON, collection -> JSON). Suite 23 -> 27. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`settings reset` (and `reset --all`) overwrote saved files with no confirmation. Both paths now prompt via AnsiConsole.ConfirmAsync, defaulting to "no" since the operation is destructive and can't be undone. A new -f/--force option skips the prompt for scripts/CI, mirroring the Auth package's `accounts delete`. README updated (prompt shown in the example + --force note); TODO item cleared. The underlying ResetAsync/ResetAllAsync remain covered by the store tests; the prompt itself is interactive glue (no command-flow harness in the suite). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduce an end-to-end harness for the `settings` branch: a Spectre.Console.Cli ITypeRegistrar adapter over Microsoft.Extensions.DependencyInjection (so DI-constructed commands resolve as in a host app) plus a runner that redirects the static AnsiConsole to a TestConsole for scripted prompt input and output capture. New CommandFlowTests cover: `settings list` rendering, and `settings reset` declined / confirmed / --force / unknown-class — closing the gap flagged when the reset confirmation prompt was added (the prompt now has real coverage). Suite 27 -> 32. Also remove TODO.md (all items resolved or dispositioned in commits/the README) and drop its reference from the README Contributing section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Record (under the still-Unreleased 0.1.0) the corrupt-file backup, `settings list` JSON rendering of complex values, and the `settings reset` confirmation prompt / --force. Bump the documented test count 22 -> 32 and note the new command-flow coverage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Works through the post-0.1.0 TODO list. Each item is its own commit.
Changes
{file}.bak(best-effort) so the next write can't destroy recoverable content; startup still falls back to defaults instead of crashing.settings listrenders complex/collection values as compact JSON instead of bare type names (MyApp.Profile,List\1[...]`). Scalars unchanged.settings resetconfirms before overwriting (defaults to "no"), with-f/--forceto skip — mirrors the Auth package'saccounts delete.ITypeRegistrar→DI adapter + aTestConsole-backed runner driving the realCommandApp. New tests coversettings listandreset(declined / confirmed /--force/ unknown-class), giving the confirmation prompt real coverage.0.1.0.TODO.md— every item is now resolved or dispositioned.TODO dispositions
settings listcomplex displayresetsettings get/setQuality
0.1.0stays Unreleased.🤖 Generated with Claude Code