Skip to content

fix(config): point system-config deprecation hints at the file, not wt config update - #4767

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-42972355677
Nov 11, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-42972355677

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

When the system config (e.g. /etc/xdg/worktrunk/config.toml) contains a deprecated setting, every command printed the generic hint To see details, run wt config show; to apply updates, run wt config update. Neither command acts on the system config: wt config update only checks the user and project files and answers "No deprecated settings found", and wt config show renders no deprecation details for the system section. So the hint led nowhere.

The system config now gets its own hint:

▲ System config: [select] is deprecated in favor of [switch.picker]
↳ wt config update leaves the system config unchanged; to apply updates, edit /etc/xdg/worktrunk/config.toml

The generic hint is shown at most once per process. Previously a system-config deprecation could use it up before the user config was checked. Now the system hint has its own path, so a user-config deprecation in the same run still prints the wt config update hint. The path reaches users through UserConfig::load_with_warnings, which runs check_and_migrate on the system file with inline warnings on.

The new test_system_config_deprecation_hint_points_at_the_file failed before the fix: stderr contained run wt config update. It covers both the system-only case and the case where both files are deprecated.

The same file also had stale doc comments, now corrected:

  • migrate_content_doc and apply_rules said the template-variable rename is a cosmetic, update-only rule. It is a structural rule applied on every load.
  • check_and_migrate said emit_inline_warnings = false is for commands other than config show. In fact wt config show and wt config update are the callers that pass false.

…t config update

A deprecated setting in the system config printed the generic hint
"to apply updates, run wt config update", but `wt config update` only
rewrites user and project config, so following it reported nothing to do.
The system config now gets its own hint naming the file to edit. A user
config deprecation in the same run keeps the `wt config update` hint.

Also corrects deprecation.rs doc comments that called the template-variable
rename cosmetic and update-only (it is a structural load-time rule) and that
inverted which callers pass `emit_inline_warnings = false`.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Nov 11, 2026
@max-sixty
max-sixty merged commit a6cbc29 into main Nov 11, 2026
36 of 45 checks passed
@max-sixty
max-sixty deleted the nightly/clean-42972355677 branch November 11, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants