forked from trent_larson/crowd-funder-for-time-pwa
pre-commit(husky): add lint-fix to checks
This commit is contained in:
@@ -1,15 +1,33 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Husky Pre-commit Hook
|
# Husky Pre-commit Hook
|
||||||
# Runs Build Architecture Guard to check staged files
|
# Runs lint-fix and Build Architecture Guard on staged files
|
||||||
#
|
#
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
echo "🔍 Running Build Architecture Guard (pre-commit)..."
|
echo "🔍 Running pre-commit hooks..."
|
||||||
bash ./scripts/build-arch-guard.sh --staged || {
|
|
||||||
|
# Run lint-fix first
|
||||||
|
echo "📝 Running lint-fix..."
|
||||||
|
npm run lint-fix || {
|
||||||
echo
|
echo
|
||||||
|
echo "❌ Linting failed. Please fix the issues and try again."
|
||||||
echo "💡 To bypass this check for emergency commits, use:"
|
echo "💡 To bypass this check for emergency commits, use:"
|
||||||
echo " git commit --no-verify"
|
echo " git commit --no-verify"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Then run Build Architecture Guard
|
||||||
|
echo "🏗️ Running Build Architecture Guard..."
|
||||||
|
bash ./scripts/build-arch-guard.sh --staged || {
|
||||||
|
echo
|
||||||
|
echo "❌ Build Architecture Guard failed. Please fix the issues and try again."
|
||||||
|
echo "💡 To bypass this check for emergency commits, use:"
|
||||||
|
echo " git commit --no-verify"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "✅ All pre-commit checks passed!"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user