Skip to content

Commit f4fd61d

Browse files
update ci to run black/isource
1 parent fb8f4fc commit f4fd61d

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ on:
77
branches: ["**"]
88

99
jobs:
10-
lint:
11-
name: Formatting (Black)
10+
format:
11+
name: Auto-format (isort + Black)
1212
runs-on: ubuntu-latest
13+
if: github.event_name == 'push'
14+
15+
permissions:
16+
contents: write
1317

1418
steps:
1519
- uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.head_ref || github.ref }}
1622

1723
- name: Set up Python 3.13
1824
uses: actions/setup-python@v5
@@ -24,11 +30,16 @@ jobs:
2430
python -m pip install --upgrade pip
2531
pip install -e ".[dev]"
2632
27-
- name: Check import ordering with isort
28-
run: isort --check-only --diff src/ tests/
33+
- name: Run isort
34+
run: isort src/ tests/
2935

30-
- name: Check formatting with Black
31-
run: black --check src/ tests/
36+
- name: Run Black
37+
run: black src/ tests/
38+
39+
- name: Commit formatting changes
40+
uses: stefanzweifel/git-auto-commit-action@v5
41+
with:
42+
commit_message: "style: auto-format with isort + Black [skip ci]"
3243

3344
test:
3445
name: Tests

0 commit comments

Comments
 (0)