File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,21 +53,7 @@ This project uses Ruff for linting and formatting. The workflow enforces these s
5353
5454To run the same checks locally:
5555``` bash
56- # Install Ruff
57- pip install ruff
58-
59- # Run linting
60- ruff check .
61-
62- # Check formatting
63- ruff format --check .
64-
65- # Auto-fix issues where possible
66- ruff check --fix .
67- ruff format .
68-
69- # Use Black to format the code
70- black .
56+ ./format.sh
7157```
7258
7359## Troubleshooting
Original file line number Diff line number Diff line change 1+ name : Format Check
2+
3+ on :
4+ pull_request :
5+ branches : [ main, master ]
6+ paths :
7+ - ' **.py'
8+ - ' evals/**'
9+ - ' stagehand/**'
10+ - ' format.sh'
11+ - ' pyproject.toml'
12+
13+ jobs :
14+ format-check :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Check out repository
18+ uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@v4
24+ with :
25+ python-version : ' 3.10'
26+
27+ - name : Install formatting dependencies
28+ run : |
29+ python -m pip install --upgrade pip
30+ pip install black isort ruff
31+
32+ - name : Make format script executable
33+ run : chmod +x ./format.sh
34+
35+ - name : Check current formatting status
36+ run : |
37+ echo "Checking current code formatting..."
38+ # Create a backup of current state
39+ git stash push -m "backup before format check"
40+
41+ - name : Run format script
42+ run : ./format.sh
43+
44+ - name : Check for formatting changes
45+ run : |
46+ if git diff --quiet; then
47+ echo "✅ Code is properly formatted!"
48+ exit 0
49+ else
50+ echo "❌ Code formatting issues detected!"
51+ echo ""
52+ echo "The following files need formatting:"
53+ git diff --name-only
54+ echo ""
55+ echo "Please run './format.sh' locally and commit the changes."
56+ echo ""
57+ echo "Detailed changes:"
58+ git diff
59+ exit 1
60+ fi
You can’t perform that action at this time.
0 commit comments