Skip to content

Commit b93f7a5

Browse files
committed
fix linting workflow
1 parent 5b5552b commit b93f7a5

File tree

2 files changed

+12
-31
lines changed

2 files changed

+12
-31
lines changed

.github/workflows/linting.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ on:
55
branches: [ main, master ]
66
paths:
77
- '**.py'
8-
- 'evals/**'
98
- 'stagehand/**'
10-
- 'format.sh'
119
- 'pyproject.toml'
1210

1311
jobs:
@@ -16,8 +14,6 @@ jobs:
1614
steps:
1715
- name: Check out repository
1816
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
2117

2218
- name: Set up Python
2319
uses: actions/setup-python@v4
@@ -29,32 +25,17 @@ jobs:
2925
python -m pip install --upgrade pip
3026
pip install black isort ruff
3127
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
3634
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
4037
41-
- name: Run format script
42-
run: ./format.sh
43-
44-
- name: Check for formatting changes
38+
- name: Run Ruff linting
4539
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

format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Define source directories (adjust as needed)
4-
SOURCE_DIRS="evals stagehand"
4+
SOURCE_DIRS="stagehand"
55

66
# Apply Black formatting only to source directories
77
echo "Applying Black formatting..."

0 commit comments

Comments
 (0)