From 47881ae410e57f7eba8d11b1ef5f81fe8b1b92a0 Mon Sep 17 00:00:00 2001 From: Wuesteon Date: Wed, 17 Dec 2025 18:39:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(husky):=20add=20helpful=20erro?= =?UTF-8?q?r=20messages=20to=20git=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add clear error messages when pre-commit checks fail - Add clear error messages when pre-push builds fail - Explicitly warn against using --no-verify flag - Encourage developers to fix issues rather than bypass checks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .husky/pre-commit | 31 ++++++++++++++++++++++++++++--- .husky/pre-push | 11 ++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 30c1cf220..20ef7bdeb 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,30 @@ -pnpm exec lint-staged -pnpm run type-check +pnpm exec lint-staged || { + echo "" + echo "❌ Pre-commit checks failed!" + echo "" + echo "Please fix the formatting/linting issues above before committing." + echo "Do NOT use 'git commit --no-verify' to bypass these checks." + echo "" + exit 1 +} + +pnpm run type-check || { + echo "" + echo "❌ Type check failed!" + echo "" + echo "Please fix the TypeScript errors above before committing." + echo "Do NOT use 'git commit --no-verify' to bypass these checks." + echo "" + exit 1 +} # Run svelte-check on staged web apps (catches a11y, imports, Svelte 5 issues) -./scripts/svelte-check-staged.sh +./scripts/svelte-check-staged.sh || { + echo "" + echo "❌ Svelte check failed!" + echo "" + echo "Please fix the Svelte errors above before committing." + echo "Do NOT use 'git commit --no-verify' to bypass these checks." + echo "" + exit 1 +} diff --git a/.husky/pre-push b/.husky/pre-push index c3bd72b64..cf5c52a73 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,3 +1,12 @@ # Run production build check before push # This catches npm package incompatibilities and Docker issues before CI/CD -./scripts/build-changed-apps.sh +./scripts/build-changed-apps.sh || { + echo "" + echo "❌ Production build check failed!" + echo "" + echo "Please fix the build errors above before pushing." + echo "These errors will cause CI/CD to fail." + echo "Do NOT use 'git push --no-verify' to bypass these checks." + echo "" + exit 1 +}