File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Format
2-
3- on :
4- push :
5- branches : [main]
6- tags : [v*]
7- pull_request :
8-
1+ name : Format Python Code
2+ on : push
93jobs :
10- format :
11- name : " Format Check"
12- runs-on : ubuntu-latest
4+ python-code-format :
5+ runs-on : ubuntu-20.04
136 steps :
14- - name : Checkout code
15- uses : actions/checkout@v4
16- - name : Set up Python
17- uses : actions/setup-python@v4
7+ - uses : actions/checkout@v2
8+ - uses : actions/setup-python@v4
189 with :
19- python-version : ' 3.x'
20- - name : Install black
10+ python-version : " 3.10"
11+ architecture : " x64"
12+ - name : Display Python version
13+ run : python --version
14+ - name : Install packages
15+ run : pip install black autopep8 isort
16+ - name : Formatter
2117 run : |
22- python -m pip install --upgrade pip
23- pip install black
24- - name : Format code with black
25- run : |
26- black . --check
27- - name : Suggest formatting changes
28- uses : reviewdog/action-suggester@v1
29- if : github.event_name == 'pull_request'
18+ black .
19+ autopep8 --recursive --in-place --aggressive --aggressive .
20+ isort .
21+ - name : Create Pull Request
22+ uses : peter-evans/create-pull-request@v3
3023 with :
31- tool_name : black
32- fail_on_error : true
24+ commit-message : Auto code format
25+ title : Fixes by format action
26+ body : This is an auto-generated PR with fixes.
27+ labels : automated pr
28+ branch : python-code-format-patches
29+
You can’t perform that action at this time.
0 commit comments