Validate shell completion across supported shells

This commit is contained in:
2026-11-03 04:16:39 +00:00
parent 96250d1887
commit 0450ecfc16
6 changed files with 207 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
# Shell completion implementation plan
Status: Stages 1–7 complete. Stage 8 is next.
Status: Stages 1–8 complete.
Implement the [shell completion roadmap](completion.md) from baseline
`2301872`. Follow the stages in order in one sprint. Intermediate stages may
@@ -305,6 +305,8 @@ checks pass.
## Stage 8: Validate the assembled sprint
Status: complete.
1. Exercise the generated scripts in Bash, Zsh, and Fish using a built fixture
executable, a disposable directory with filenames and directories containing
spaces, and isolated shell configuration. Verify actual completion output
@@ -323,3 +325,21 @@ checks pass.
dependency, and no changes to ordinary routing, flag acceptance, or report
behavior outside the selected completion scope. Review documentation links,
formatting, and the final diff. Record the actual validation results.
Completion: the opt-in `TestCompletionConsumerInShells` builds a CommandKit
fixture, generates its scripts, and verifies edited invocations and displayed
descriptions in interactive Bash 5.3.9, Zsh 5.9, and Fish 4.2.1. The fixture
uses isolated shell configuration and paths containing spaces. Run it with
Python pexpect, Bash completion, and the three shells available using
`COMMANDKIT_COMPLETION_SHELLS=1 GOTOOLCHAIN=local go test -count=1 -run
'^TestCompletionConsumerInShells$' .`. Zsh and Fish were extracted to a
disposable directory for this run; their executable, library, Zsh module, and
function paths were supplied through `PATH`, `LD_LIBRARY_PATH`,
`COMPLETION_ZSH_MODULE_PATH`, and `COMPLETION_ZSH_FUNCTION_ROOT`, respectively.
The adapter's interactive
transport matrix and additional short-equals and Unicode-basename checks also
pass in all three shells. The root and both optional module suites pass in the
local workspace, as does the root suite with `GOWORK=off`. Public GoDoc and
dependency checks show no exposed backend types or reverse optional-module
dependency. Existing execution suites, changed documentation links, formatting,
and diff whitespace checks pass. The local workspace file is ignored.