Skip to content

Commit 796c9cd

Browse files
committed
actions: add python code format check
1 parent f40e433 commit 796c9cd

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/python-format.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Python Format
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.py'
7+
8+
jobs:
9+
python_format:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout base version
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 100
16+
ref: ${{ github.event.pull_request.base.sha }}
17+
18+
- name: checkout head version
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 100
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
24+
- name: install darker
25+
run: "python3 -m pip install darker"
26+
27+
- name: check python format
28+
run: "python3 -m darker --check --diff -r `git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}`...HEAD ."

0 commit comments

Comments
 (0)