Initial commit

This commit is contained in:
Lina Tawfik
2025-05-19 08:32:32 -07:00
commit f66f337f4e
58 changed files with 8913 additions and 0 deletions

13
scripts/install-hooks.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Install git hooks
echo "Installing git hooks..."
# Make sure hooks directory exists
mkdir -p .git/hooks
# Install pre-push hook
cp scripts/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
echo "Git hooks installed successfully!"

46
scripts/pre-push Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/sh
# Check if files need formatting before push
echo "Checking code formatting..."
# First check if any files need formatting
if ! bun run format:check; then
echo "Code formatting errors found. Running formatter..."
bun run format
# Check if there are any staged changes after formatting
if git diff --name-only --exit-code; then
echo "All files are now properly formatted."
else
echo ""
echo "ERROR: Code has been formatted but changes need to be committed!"
echo "Please commit the formatted files and try again."
echo ""
echo "The following files were modified:"
git diff --name-only
echo ""
exit 1
fi
else
echo "Code formatting is already correct."
fi
# Run type checking
echo "Running type checking..."
if ! bun run typecheck; then
echo "Type checking failed. Please fix the type errors and try again."
exit 1
else
echo "Type checking passed."
fi
# Run tests
echo "Running tests..."
if ! bun run test; then
echo "Tests failed. Please fix the failing tests and try again."
exit 1
else
echo "All tests passed."
fi
exit 0