Skip to content

Commit 9f3e39e

Browse files
yunlongwenqwencoder
andcommitted
fix: 简化 pre-push hook 只运行 lint 和 format
测试运行较慢,建议在本地手动运行 pytest。 pre-push 专注于快速的代码格式检查。 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent 0c821a2 commit 9f3e39e

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

scripts/pre-push.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Pre-push hook - runs before pushing to remote
3-
# This hook runs tests to catch issues before they reach CI
3+
# This hook runs lint and format checks before push
44

55
set -e
66

@@ -27,16 +27,7 @@ python3 -m ruff format . || {
2727
exit 1
2828
}
2929

30-
# Run tests (only if test files exist)
31-
if python3 -m pytest --collect-only -q 2>&1 | grep -q "test session starts"; then
32-
echo "🧪 Running tests..."
33-
python3 -m pytest --no-cov -q || {
34-
echo "❌ Tests failed. Please fix failing tests."
35-
exit 1
36-
}
37-
else
38-
echo "⚠️ No tests found, skipping..."
39-
fi
40-
4130
echo "✅ All pre-push checks passed!"
31+
echo ""
32+
echo "💡 Tip: Run 'pytest' locally before pushing to catch test failures."
4233
exit 0

0 commit comments

Comments
 (0)