Tests added, see the documentation in the tests directory for details. Improved the socket code.
This commit is contained in:
@@ -109,8 +109,25 @@ else
|
||||
echo -e "${GREEN}✓ Core module imports successful${NC}"
|
||||
fi
|
||||
|
||||
# 4. Check for secrets or sensitive data
|
||||
echo -e "\n${YELLOW}4. Checking for potential secrets...${NC}"
|
||||
# 4. Run test suite
|
||||
echo -e "\n${YELLOW}4. Running test suite...${NC}"
|
||||
if command -v pytest >/dev/null 2>&1; then
|
||||
# Run tests quietly, show summary at end
|
||||
if pytest tests/ -q --tb=short 2>&1 | tail -20; then
|
||||
echo -e "${GREEN}✓ All tests passed${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Test suite failed${NC}"
|
||||
echo "Run: pytest tests/ -v (to see details)"
|
||||
VALIDATION_FAILED=1
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}⚠ pytest not installed - skipping tests${NC}"
|
||||
echo " Install with: pip install pytest"
|
||||
echo " Or full test suite: pip install -r tests/requirements.txt"
|
||||
fi
|
||||
|
||||
# 5. Check for secrets or sensitive data
|
||||
echo -e "\n${YELLOW}5. Checking for potential secrets...${NC}"
|
||||
SECRETS_FOUND=0
|
||||
|
||||
if [ -n "$STAGED_PYTHON_FILES" ]; then
|
||||
@@ -144,6 +161,7 @@ else
|
||||
echo ""
|
||||
echo "Quick fixes:"
|
||||
echo " • Python syntax: python3 tools/validate_syntax.py --fix"
|
||||
echo " • Run tests: pytest tests/ -v"
|
||||
echo " • Review flagged files manually"
|
||||
echo " • Re-run commit after fixes"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user