Honor spec-style daemon and cache config keys#35
Draft
CoreyRDean wants to merge 1 commit into
Draft
Conversation
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.
Non-technical summary
intentnow honors the daemon/cache config keys exactly where the spec says they live, so users can editconfig.tomlwith sectioned TOML keys and have those settings actually take effect. This matters now because the previous behavior silently ignored spec-shaped keys like[daemon] enabled = false, which turns a valid-looking config edit into a no-op.Technical summary
internal/configto parse both legacy flat aliases (daemon_enabled,cache_enabled) and spec-style sectioned keys (daemon.enabled,cache.enabledplusdaemon.idle_unload_after)i config get/setknown-key handling sodaemon.enabled,daemon.idle_unload_after, andcache.enabledround-trip through the CLI instead of only through raw file editsconfig set/get daemon.enabledpersists the spec-style key end to endgo test ./internal/config/... ./internal/cli/...,go test ./...,go vet ./...,make buildAdditional notes
Trade-off: generated config now uses dotted TOML keys (
daemon.enabled = false) rather than the older underscore aliases, which is semantically equivalent to the sectioned TOML shown in the spec and keeps the file machine-editable without widening this change into a broader config-format rewrite.Deferred: I did not normalize every raw dotted key into explicit TOML table blocks; the only goal here was to close the spec/implementation gap for the known daemon/cache settings without risking unrelated config churn.