docs and tools
This commit is contained in:
parent
d3638e2e69
commit
917ab0a584
5 changed files with 54 additions and 5 deletions
27
.githooks/pre-commit
Executable file
27
.githooks/pre-commit
Executable 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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue