Conversation
Extend the existing Husky setup to cover ui/goose2/, replicating the checks that block/goose2 ran via Lefthook. Pre-commit (when staged files touch ui/goose2/): - Biome auto-format and auto-fix with staged file re-add - pnpm check (biome check + file size + i18n string checks) Pre-push (when pushed commits touch ui/goose2/): - Biome format verification (read-only) - cargo fmt --check in src-tauri/ - cargo clippy -- -D warnings in src-tauri/ - pnpm check (biome check + file size + i18n) - pnpm test (vitest) - pnpm build (tsc + vite build) - cargo check in src-tauri/ All pre-push jobs run in parallel via background subshells, matching the parallelization Lefthook provided. The hooks use whole-directory checks (not lint-staged), consistent with how goose2 was configured. Signed-off-by: Matt Toohey <contact@matttoohey.com>
Replace inlined pnpm/cargo commands with `just goose2 <recipe>` calls, matching how block/goose2's Lefthook config delegated to just. This also fixes the missing pnpm typecheck (now included via `just goose2 check`) and eliminates drift risk between hooks and justfile recipes. Pre-commit now uses targeted re-staging of only ui/goose2/ files instead of `git add -u` which would re-stage all tracked files. Pre-push replaces six inlined command groups with: - just goose2 fmt-check - just goose2 clippy - just goose2 check - just goose2 test - just goose2 build - just goose2 tauri-check Rebased onto origin/main to pick up the `mod goose2 'ui/goose2'` directive added in #8570. Signed-off-by: Matt Toohey <contact@matttoohey.com>
Move ref-parsing, path-detection, and parallel-execution logic into reusable shell functions so the hook body reads as pure intent — just a list of just recipes to run. Failure messages now name the recipe that failed instead of reporting PID numbers. Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e1432515c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| local -a labels=() pids=() | ||
| while [[ $# -ge 2 ]]; do |
There was a problem hiding this comment.
Make pre-push hook executable by its required shell
The new hook uses Bash-only syntax (local -a, [[ ... ]], array expansion) but the file has no shebang, so Git runs it via /bin/sh on ENOEXEC; in POSIX shells this fails to parse (for example, sh -n .husky/pre-push errors at this line), which prevents git push whenever this hook is installed. Add an explicit Bash shebang (and ensure Bash is available) or rewrite the function in POSIX sh so pushes are not blocked by a syntax error.
Useful? React with 👍 / 👎.
Add a root-level `setup` recipe that sets `core.hooksPath` to `.husky`, ensuring the git hooks are active after a fresh clone. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the Husky activation (`git config core.hooksPath .husky`) into `just goose2 setup` since that's the module that uses the hooks. This keeps setup co-located with the hooks it enables. Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac5d310aee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| # Run goose2 checks if any staged files are under ui/goose2/ | ||
| if git diff --cached --name-only | grep -q '^ui/goose2/'; then | ||
| if [ -d "ui/goose2" ]; then |
There was a problem hiding this comment.
Reset working dir before goose2 checks
When staged changes include both ui/desktop/ and ui/goose2/, the earlier block runs cd ui/desktop && pnpm exec lint-staged and leaves the hook in ui/desktop; this makes the new relative check -d "ui/goose2" evaluate false, so the hook prints a warning and skips all goose2 pre-commit checks. That creates a real bypass for the new validation path whenever both areas are committed together.
Useful? React with 👍 / 👎.
Summary
push_touches,run_parallel) for hook plumbing (these came for free in lefthook)Test plan
ui/goose2/ui/goose2/changes🤖 Generated with Claude Code