Skip to content

Commit 030ffb6

Browse files
committed
feat(husky): add pre-push hook for automated checks before pushing code
1 parent c46189c commit 030ffb6

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.husky/pre-push

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd SortVision || exit 1
5+
6+
echo "Running pre-push checks (format, lint, build)..."
7+
pnpm run check:push
8+
RESULT=$?
9+
10+
if [ $RESULT -ne 0 ]; then
11+
echo "Pre-push checks failed. Push aborted."
12+
exit $RESULT
13+
fi
14+
15+
echo "Pre-push checks passed."

SortVision/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"test:extended": "node tests/quality-assurance.mjs --extended",
1212
"dev": "next dev --turbopack",
1313
"build": "next build",
14+
"check:push": "pnpm run format:check && pnpm run lint && pnpm run build",
1415
"start": "next start",
1516
"lint": "eslint .",
1617
"lint:fix": "eslint . --fix",

0 commit comments

Comments
 (0)