Repository navigation
feat(config): add WORKTRUNK_PROJECT_CONFIG_PATH override - #2267
Merged
Merged
Conversation
Adds a `WORKTRUNK_PROJECT_CONFIG_PATH` environment variable that overrides the project config path, mirroring the existing `WORKTRUNK_CONFIG_PATH` (user) and `WORKTRUNK_SYSTEM_CONFIG_PATH` (system) overrides. Uses it to fully isolate completion tests in `shell_wrapper.rs`, which previously only isolated user and system config. After PR #2266 made aliases appear as completion candidates, any `[aliases]` added to this repo's own `.config/wt.toml` would silently pollute completion snapshots. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 16, 2026
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.
Adds a `WORKTRUNK_PROJECT_CONFIG_PATH` environment variable that overrides the project config path, mirroring the existing `WORKTRUNK_CONFIG_PATH` (user) and `WORKTRUNK_SYSTEM_CONFIG_PATH` (system) overrides. Missing files at the overridden path resolve to no project config — same as a missing `.config/wt.toml` today.
Uses it to fully isolate completion tests in `tests/integration_tests/shell_wrapper.rs`, which previously only isolated user and system config. After #2266 made aliases appear as top-level completion candidates at `wt `, any `[aliases]` added to this repo's own `.config/wt.toml` would silently pollute completion snapshots. The helper `set_empty_user_config` is renamed `set_empty_configs` and now points all three env vars at `/dev/null`.
Also cleans up `wt config show --format=json` to use `project_config_path()` for the `project.path` field (was hardcoded `.config/wt.toml`), so the override is reflected in both path and config.
`configure_cli_command` intentionally leaves `WORKTRUNK_PROJECT_CONFIG_PATH` unset — the `WORKTRUNK_*` env_remove loop prevents host leakage, and setting it would break tests that rely on the default `.config/wt.toml` lookup in their own test repo. Completion tests opt in explicitly via `set_empty_configs`.
Test plan