Skip to content

refactor: check-completions belongs to zarg, not scripts/lib - #83

Merged
radiosilence merged 1 commit into
mainfrom
zarg-owns-completions
Aug 7, 2026
Merged

refactor: check-completions belongs to zarg, not scripts/lib#83
radiosilence merged 1 commit into
mainfrom
zarg-owns-completions

Conversation

@radiosilence

Copy link
Copy Markdown
Owner

scripts/lib/check-completionszsh-plugins/zarg/check-completions.zsh.

It greps consumers for zarg_go and pipes zarg's emitted completions into the shells they target. That's zarg's integration test — it sat in the scripts' helper directory only because that's where I happened to write it.

Now it lives next to the unit suite it complements:

zsh zsh-plugins/zarg/test.zsh                # zarg itself, against a fixture
zsh zsh-plugins/zarg/check-completions.zsh   # every real consumer

scripts/lib/ is left holding just common.zsh, which is what it claimed to be — _dt_* output helpers, nothing to do with parsing.

Details worth checking

  • The .zsh suffix is load-bearing. CI's syntax step globs zsh-plugins/*/*.zsh; without the suffix the file would have silently dropped out of that check.
  • Path depth is unchanged. scripts/lib/x and zsh-plugins/zarg/x are both three levels down, so the ${0:A:h:h:h} root resolution still lands on the repo root — verified by running it from a different cwd.
  • It doesn't try to check itself: the sweep greps for a leading zarg_go, which this file doesn't have.

Verify

zsh zsh-plugins/zarg/test.zsh                # 32 passed
zsh zsh-plugins/zarg/check-completions.zsh   # 16 scripts incl. wtclean

I also reproduced CI's syntax loop locally in bash to confirm the moved file is still picked up, and re-ran the sweep from /tmp to confirm path resolution.

References updated in lefthook.yml, .github/workflows/scripts.yml, scripts/README.md and CHANGELOG.md; zarg's README gains a Tests section describing both.

🤖 Generated with Claude Code

https://claude.ai/code/session_014CzNvwMVqrpyy2N1vhHQui

It greps consumers for zarg_go and pipes zarg's emitted completions into
the shells they target — that's zarg's integration test, and it sat in the
scripts' helper directory only because that's where it was written.

Moved to zsh-plugins/zarg/check-completions.zsh, next to the unit suite it
complements. The .zsh suffix keeps it inside CI's existing zsh-plugins/*/*.zsh
syntax glob; path depth is unchanged, so its root resolution still holds.

scripts/lib/ is now just common.zsh, which is what it claimed to be: output
helpers, nothing to do with parsing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014CzNvwMVqrpyy2N1vhHQui
@radiosilence
radiosilence merged commit 5edc687 into main Aug 7, 2026
2 checks passed
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.

1 participant