Skip to content

docs(alias): correct the vars.* claim in alias dry-run - #3639

Merged
max-sixty merged 2 commits into
mainfrom
hook-preview-shared-context
Jul 29, 2026
Merged

docs(alias): correct the vars.* claim in alias dry-run#3639
max-sixty merged 2 commits into
mainfrom
hook-preview-shared-context

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#3638 changed the preview renderer so a template expands everything around a {{ vars.<key> }} reference and leaves only that reference literal. wt config alias dry-run shares that renderer, but its --help text and the handle_alias_dry_run docstring still described the previous all-or-nothing behavior, where a single vars. token left the whole template raw.

This corrects both. The docstring's mention of a separate syntax-validation step goes with them: expansion reports syntax errors itself, so there is no longer a distinct validation pass to describe.

No behavior change. The dry-run long help isn't rendered into any generated doc or snapshot, so no mirrors move with it.

This was written by Claude Code on behalf of max

max-sixty and others added 2 commits July 28, 2026 16:48
The preview renderer now expands everything but the vars reference
itself, so "templates referencing vars.* are shown unexpanded" no longer
describes what alias dry-run does. The mention of a separate syntax
validation step goes too — expansion reports those itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@max-sixty
max-sixty merged commit a07fe6d into main Jul 29, 2026
39 checks passed
@max-sixty
max-sixty deleted the hook-preview-shared-context branch July 29, 2026 00:37
@worktrunk-bot worktrunk-bot mentioned this pull request Jul 29, 2026
max-sixty added a commit that referenced this pull request Jul 29, 2026
)

`wt hook show` decided whether a section had printed anything from
whether the config held an entry for each hook type, not from whether
any command was rendered. A hook type declared with an empty command
list has an entry but no commands, so the section printed its heading
and then stopped:

```console
$ cat .config/wt.toml
post-switch = []

$ wt hook show
PROJECT HOOKS @ /path/.config/wt.toml
```

Both sections carried it, since the loop and the `(none configured)`
fallback were duplicated in `render_user_hooks` and
`render_project_hooks`. `render_hook_commands` now reports whether it
wrote any rows, and the loop plus fallback live once in
`render_hook_section`, which both callers delegate to. The flag means
"something was printed", which is what the `(none configured)` line
claims.

The execution path was already correct: an empty list announces nothing,
and the JSON output omits it. Verified against the built binary across
four cases (project-only empty, user-only empty, an empty list alongside
a real hook, and a filter naming the empty type), and pinned by
`test_hook_show_empty_command_lists`, which covers both the user and
project halves. Reverting the flag to its old meaning fails the test on
both.

Also corrects a docstring in the same file that still described the
preview's pre-#3638 behavior ("shows a `vars.*` template raw"), the same
drift #3639 fixed for `wt config alias dry-run`.

> _This was written by Claude Code on behalf of max_

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
max-sixty added a commit that referenced this pull request Jul 29, 2026
Two commits landed on `main` while #3640's CI ran, so they ship in
0.70.0 but weren't in its changelog. The release's drift check caught
them before the tag.

- **#3641** — a user-facing fix: `wt hook show` printed a section
heading and nothing else for a hook type declared with an empty command
list. Added as its own Fixed entry.
- **#3639** — help-text only, no behavior change, correcting `wt config
alias dry-run`'s description of the `vars.*` preview. Folded into the
existing hook-previews bullet, since it's the same feature's
documentation catching up rather than a separate change.

No version change; `v0.70.0` is tagged after this lands so the tag
covers both.

> _This was written by Claude Code on behalf of Maximilian_
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