- Fix fill and priority boolean attributes in Hero component - Improve next/image mock in Jest setup to handle boolean props correctly - Enhance pre-push hook with better Docker detection and error handling - Make Docker build test non-blocking (warnings instead of errors) - Add executable permissions for secret check script - Prevent React DOM warnings in tests
Git Hooks
This directory contains Git hooks for the Portfolio project.
Pre-Push Hook
The pre-push hook runs automatically before every git push and performs the following checks:
Checks Performed:
- Node.js Version Check - Ensures Node.js 20+ is installed
- Dependency Installation - Installs npm dependencies if needed
- Linting - Runs ESLint to check code quality
- Tests - Runs Jest test suite
- Build - Builds the Next.js application
- Security Audit - Runs npm audit for vulnerabilities
- Secret Detection - Checks for accidentally committed secrets
- Docker Configuration - Validates Dockerfile and docker-compose.yml
- Production Checks - Additional checks when pushing to production branch
Production Branch Special Checks:
- Environment file validation
- Docker build test
- Deployment readiness check
Usage:
The hook runs automatically on every push. To manually test it:
# Test the hook manually
.githooks/pre-push
# Or push to trigger it
git push origin main
Bypassing the Hook:
If you need to bypass the hook in an emergency:
git push --no-verify origin main
Note: Only bypass in emergencies. The hook prevents broken code from being pushed.
Troubleshooting:
If the hook fails:
- Fix the reported issues (linting errors, test failures, etc.)
- Run the checks manually to debug:
npm run lint npm run test npm run build npm audit - Check Node.js version:
node --version(should be 20+) - Reinstall dependencies:
rm -rf node_modules && npm ci
Configuration:
The hook is configured in .git/config:
[core]
hooksPath = .githooks
To disable hooks temporarily:
git config core.hooksPath ""
To re-enable:
git config core.hooksPath .githooks