Repository navigation
Commit a41cdb8
authored
docs(config): name every template variable format_path builds (#3782)
Found by the nightly survey while reviewing
`src/config/user/accessors.rs`.
`UserConfig::format_path`'s `# Arguments` block doesn't match what the
function builds. It documents `{{ main_worktree }}`, `{{ branch }}`, and
`{{ owner }}`, and describes the `repo` parameter as being for "template
function access" — but the function also inserts `{{ repo }}` (from
`main_worktree`, not from `repo`) and `{{ repo_path }}` (read off
`repo`). Both omissions are in `default_worktree_path()` in the same
file — `"{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"` — so
the docstring omits two of the three variables the default template
uses.
The `{{ owner }}` line was also a bare bullet in the middle of the
parameter list, describing a template variable rather than an argument,
and it didn't note that `owner` is only inserted when
`primary_remote_parsed_url()` returns a URL it can parse.
This corrects the parameter descriptions, moves the template-variable
note out of the argument list, and links the user-facing variable list
at
[worktrunk.dev/config](https://worktrunk.dev/config/#worktree-path-template)
rather than duplicating it here (verified: the page returns 200 and
carries that anchor).
No test: the change is a doc comment only, with no behavior to exercise.
`cargo fmt --check` and `cargo doc --no-deps -p worktrunk` are clean.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>1 parent ec0f3a3 commit a41cdb8
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
233 | 234 | | |
234 | | - | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
238 | 244 | | |
239 | 245 | | |
240 | 246 | | |
| |||
0 commit comments