goose/.husky/pre-commit
Matt Toohey 18e0668aaf
Some checks are pending
Canary / Prepare Version (push) Waiting to run
Canary / build-cli (push) Blocked by required conditions
Canary / Upload Install Script (push) Blocked by required conditions
Canary / bundle-desktop (push) Blocked by required conditions
Canary / bundle-desktop-intel (push) Blocked by required conditions
Canary / bundle-desktop-linux (push) Blocked by required conditions
Canary / bundle-desktop-windows (push) Blocked by required conditions
Canary / Release (push) Blocked by required conditions
Unused Dependencies / machete (push) Waiting to run
CI / changes (push) Waiting to run
CI / Check Rust Code Format (push) Blocked by required conditions
CI / Build and Test Rust Project (push) Blocked by required conditions
CI / Build Rust Project on Windows (push) Waiting to run
CI / Check MSRV (push) Blocked by required conditions
CI / Lint Rust Code (push) Blocked by required conditions
CI / Check Generated Schemas are Up-to-Date (push) Blocked by required conditions
CI / Test and Lint Electron Desktop App (push) Blocked by required conditions
Goose 2 CI / Lint & Format (push) Waiting to run
Goose 2 CI / Unit Tests (push) Waiting to run
Goose 2 CI / Desktop Build & E2E (push) Waiting to run
Goose 2 CI / Rust Lint (push) Waiting to run
Live Provider Tests / Smoke Tests (push) Blocked by required conditions
Live Provider Tests / Smoke Tests (Code Execution) (push) Blocked by required conditions
Live Provider Tests / check-fork (push) Waiting to run
Live Provider Tests / changes (push) Blocked by required conditions
Live Provider Tests / Build Binary (push) Blocked by required conditions
Live Provider Tests / Compaction Tests (push) Blocked by required conditions
Live Provider Tests / goose server HTTP integration tests (push) Blocked by required conditions
Publish Docker Image / docker (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
feat(goose2): add cross-worktree kill support with running/kill-all recipes (#8768)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 15:48:01 +00:00

39 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
set -e
# Only auto-format desktop TS code if relevant files are modified
if git diff --cached --no-renames --name-only | grep -q "^ui/desktop/"; then
if [ -d "ui/desktop" ]; then
(cd ui/desktop && pnpm exec lint-staged)
else
echo "Warning: ui/desktop directory does not exist, skipping lint-staged"
fi
fi
# Run goose2 checks if any staged files are under ui/goose2/
if git diff --cached --no-renames --name-only | grep -q '^ui/goose2/'; then
if [ -d "ui/goose2" ]; then
REPO_ROOT="$(pwd)"
echo "Running goose2 pre-commit checks..."
# Auto-format only staged files that biome can process, then re-stage them.
# Exclude justfile and .swift files — biome doesn't understand these formats
# and would fail with "no files were processed" when only such files are staged.
STAGED_FILES=$(git diff --cached --no-renames --diff-filter=ACMR --name-only \
| grep '^ui/goose2/' \
| grep -v -E '(^ui/goose2/justfile$|\.swift$)' \
| sed 's|^ui/goose2/||' || true)
if [ -n "$STAGED_FILES" ]; then
cd ui/goose2
echo "$STAGED_FILES" | xargs npx biome format --write
echo "$STAGED_FILES" | xargs npx biome check --fix
cd "$REPO_ROOT"
git diff --cached --no-renames --diff-filter=ACMR --name-only | grep '^ui/goose2/' | xargs git add
fi
# Run checks (biome check + file sizes + i18n + typecheck)
just goose2 check
else
echo "Warning: ui/goose2 directory does not exist, skipping goose2 checks"
fi
fi