Skip to content

Add mapbox config list/unset alongside get/set - #42

Merged
mattpodwysocki merged 1 commit into
mainfrom
feat/177-config-list-unset
Sep 23, 2026
Merged

mattpodwysocki merged 1 commit into
mainfrom
feat/177-config-list-unset

Conversation

@mattpodwysocki

Copy link
Copy Markdown
Contributor

Summary

Re-opened as a new PR: #39 was auto-closed when its stacked base branch (feat/106-persisted-config, from #35) was deleted on merge — GitHub closes rather than retargets a PR in that situation. Same content, now based directly on main since #35 is merged.

  • mapbox config list: every setting and its current value in one call, rather than one key at a time.
  • mapbox config unset <key>: clears a key back to "never set" rather than writing its current default value explicitly. The two read identically through resolve() today, but they're not the same fact on disk — a later default change reaches a cleared key and not one a caller pinned to the old default on purpose.
  • get/list now share one resolve() so the two can't answer a key differently; unset gets a clear() counterpart to set's Some(enabled).

Test plan

  • cargo build, cargo fmt, cargo clippy --all-targets -- -D warnings, cargo test — all clean
  • New unit tests in src/config.rs for resolve/clear
  • New integration tests in tests/config.rs: list reports the one known key at its default and after a set, in both text and JSON; unset is proven to remove the key from the file rather than just re-writing its default value (checked against the raw file contents, not just the CLI's own read-back)
  • docs/commands.md and CHANGELOG updated
  • Already approved as Add mapbox config list/unset alongside get/set #39 before the base-branch mishap

get/set answer one key at a time; list answers all of them in one call,
each falling back to its default the same way get does — worth having
before a second setting makes the gap between "check everything" and
"check one key" visible.

unset clears a key back to "never set" rather than writing its current
default value explicitly. The two read identically through resolve() today,
but they are not the same fact on disk: a later default change reaches a
cleared key, and does not reach one a caller pinned to the old default on
purpose. clear() is unset's counterpart to set()'s Some(enabled), and
get/list now share one resolve() so the two cannot answer a key
differently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mattpodwysocki
mattpodwysocki requested a review from a team as a code owner September 23, 2026 13:03
@mattpodwysocki
mattpodwysocki merged commit 09ce15e into main Sep 23, 2026
16 checks passed
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.

2 participants