mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 11:40:25 +00:00
14 lines
510 B
Bash
14 lines
510 B
Bash
#!/usr/bin/env sh
|
|
npx lint-staged
|
|
|
|
# Run Python pre-commit checks if backend files are staged
|
|
if git diff --cached --name-only | grep -q "^backend/"; then
|
|
echo "Running backend pre-commit checks..."
|
|
cd backend
|
|
# Get staged backend Python files, remove 'backend/' prefix for pre-commit
|
|
staged_files=$(git diff --cached --name-only | grep '^backend/.*\.py$' | sed 's|^backend/||')
|
|
if [ -n "$staged_files" ]; then
|
|
SKIP=no-commit-to-branch uv run pre-commit run --files $staged_files
|
|
fi
|
|
cd ..
|
|
fi
|