Skip to main content
Glama
pre-commitโ€ข2.1 kB
echo "๐Ÿ” Running pre-commit validations..." # Check for sensitive files first (exclude .env.example which is a template) echo "๐Ÿ” Checking for sensitive files..." if git diff --cached --name-only | grep -E "\.(key|pem|p12|pfx)$|\.env$|\.env\.(local|development|test|production)$" > /dev/null; then echo "โŒ Attempting to commit sensitive files. Please remove them from the commit." git diff --cached --name-only | grep -E "\.(key|pem|p12|pfx)$|\.env$|\.env\.(local|development|test|production)$" exit 1 fi # NEW: Check for untracked source files that might be imported (REQ-2) echo "๐Ÿ” Checking for untracked source files..." UNTRACKED_SRC=$(find src -name "*.ts" -type f 2>/dev/null | while read -r file; do if ! git ls-files --error-unmatch "$file" >/dev/null 2>&1; then echo "$file" fi done) if [ -n "$UNTRACKED_SRC" ]; then echo "โŒ Found untracked source files that may cause CI failures:" echo "$UNTRACKED_SRC" echo "" echo "๐Ÿ’ก These files exist locally but are not tracked by git." echo " CI will fail because it only sees tracked files." echo " Add these files: git add <files>" exit 1 fi # NEW: Validate gitignore patterns don't ignore source code (REQ-2) echo "๐Ÿ” Validating .gitignore patterns..." IGNORED_SRC=$(git check-ignore src/**/*.ts 2>/dev/null || true) if [ -n "$IGNORED_SRC" ]; then echo "โŒ Source files are being ignored by .gitignore:" echo "$IGNORED_SRC" echo "" echo "๐Ÿ’ก This WILL cause CI failures. Fix .gitignore patterns." echo " Use leading '/' to anchor patterns to repository root." echo " Example: '/memory/' only matches root-level memory directory" exit 1 fi # Run CI validation (same as CI: audit, format:check, lint:strict, typecheck, test:coverage) echo "๐Ÿ—๏ธ Running CI validation..." timeout 800s npm run validate:ci if [ $? -ne 0 ]; then echo "โŒ CI validation failed. Please fix the issues above." echo "๐Ÿ’ก CI validation includes: security audit, format check, strict lint (zero warnings), typecheck, tests with coverage." exit 1 fi echo "โœ… Pre-commit validations passed!"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/keyurgolani/ThoughtMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server