docs and tools

This commit is contained in:
counterweight 2025-12-20 23:09:46 +01:00
parent d3638e2e69
commit 917ab0a584
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
5 changed files with 54 additions and 5 deletions

27
.githooks/pre-commit Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
# Pre-commit hook to ensure generated types and constants are up-to-date
set -e
echo "🔍 Checking shared constants..."
cd backend && uv run python validate_constants.py
cd ..
echo "🔍 Checking if generated types are fresh..."
# Check if api.ts is staged
if git diff --cached --name-only | grep -q "frontend/app/generated/api.ts"; then
echo "✓ Generated types are staged"
else
# Check if backend schema files have changed
if git diff --cached --name-only | grep -qE "backend/(schemas|models|routes)"; then
echo "⚠️ Backend schema files changed but generated types not staged."
echo " Run 'make generate-types-standalone' and stage the changes."
echo ""
echo " To skip this check (not recommended): git commit --no-verify"
exit 1
fi
fi
echo "✅ Pre-commit checks passed"