-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-push
More file actions
executable file
Β·34 lines (28 loc) Β· 942 Bytes
/
pre-push
File metadata and controls
executable file
Β·34 lines (28 loc) Β· 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env sh
echo "π Running pre-push checks..."
# Activate virtual environment if it exists
if [ -d "venv" ]; then
echo "π§ Activating virtual environment..."
source venv/bin/activate
fi
# Run tests to ensure code quality
echo "π§ͺ Running tests..."
if ! pytest --html=tests/test-report/test-report.html; then
echo "β Tests failed. Please fix before pushing."
exit 1
fi
# Run coverage check
echo "π Checking test coverage..."
if ! pytest --cov=contentstack_utils --cov-report=term-missing; then
echo "β Coverage check failed. Please improve test coverage."
exit 1
fi
# Run security scan on dependencies (optional)
if [ -n "$SNYK_TOKEN" ]; then
echo "π Running comprehensive Snyk scan..."
if ! snyk test --severity-threshold=high; then
echo "β High severity vulnerabilities found. Please fix before pushing."
exit 1
fi
fi
echo "β
All pre-push checks passed!"