Skip to content

Commit 45b1aaa

Browse files
committed
changed formatter
1 parent a46b24a commit 45b1aaa

1 file changed

Lines changed: 24 additions & 27 deletions

File tree

.github/workflows/format.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
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
93
jobs:
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+

0 commit comments

Comments
 (0)