Update the remaining docstrings, update pre-commit hook, add docstring formatting CI, update CONTRIBUTING with formatting guidance (#2089)
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
NO_COLOR=1 ruff format --diff
|
||||
# Color codes for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo "🔍 Running pre-commit checks..."
|
||||
|
||||
# Change to project root (one level up from scripts/)
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Format check
|
||||
echo "📝 Checking code formatting..."
|
||||
if ! NO_COLOR=1 ruff format --diff --check; then
|
||||
echo -e "${RED}❌ Code formatting issues found. Run 'ruff format' to fix.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Lint check
|
||||
echo "🔍 Running linter..."
|
||||
if ! ruff check; then
|
||||
echo -e "${RED}❌ Linting issues found.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}✅ All pre-commit checks passed!${NC}"
|
||||
Reference in New Issue
Block a user