Files
noteflow/scripts/hooks/pre-commit

31 lines
727 B
Bash
Executable File

#!/usr/bin/env bash
# Pre-commit hook for NoteFlow
# Runs quality checks before allowing commits
#
# Install: make install-hooks
# Bypass: git commit --no-verify
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Running pre-commit quality checks...${NC}"
# Get the repo root (in case hook is run from subdirectory)
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$REPO_ROOT"
# Run make quality
if make quality; then
echo -e "${GREEN}✓ All quality checks passed${NC}"
exit 0
else
echo -e "${RED}✗ Quality checks failed${NC}"
echo -e "${YELLOW}Fix the issues above or use 'git commit --no-verify' to bypass${NC}"
exit 1
fi