5
5
branches : [ main, master ]
6
6
paths :
7
7
- ' **.py'
8
- - ' evals/**'
9
8
- ' stagehand/**'
10
- - ' format.sh'
11
9
- ' pyproject.toml'
12
10
13
11
jobs :
16
14
steps :
17
15
- name : Check out repository
18
16
uses : actions/checkout@v4
19
- with :
20
- fetch-depth : 0
21
17
22
18
- name : Set up Python
23
19
uses : actions/setup-python@v4
@@ -29,32 +25,17 @@ jobs:
29
25
python -m pip install --upgrade pip
30
26
pip install black isort ruff
31
27
32
- - name : Make format script executable
33
- run : chmod +x ./format.sh
34
-
35
- - name : Check current formatting status
28
+ - name : Check Black formatting
29
+ run : |
30
+ echo "Checking Black formatting..."
31
+ black --check --diff stagehand
32
+
33
+ - name : Check import sorting
36
34
run : |
37
- echo "Checking current code formatting..."
38
- # Create a backup of current state
39
- git stash push -m "backup before format check"
35
+ echo "Checking import sorting..."
36
+ isort --check-only --diff stagehand
40
37
41
- - name : Run format script
42
- run : ./format.sh
43
-
44
- - name : Check for formatting changes
38
+ - name : Run Ruff linting
45
39
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
40
+ echo "Running Ruff linting..."
41
+ ruff check stagehand
0 commit comments