-
-
Notifications
You must be signed in to change notification settings - Fork 141
36 lines (33 loc) · 998 Bytes
/
flake8_yapf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Flake8 and yapf
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install flake8
pip install yapf
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
- name: yapf
id: yapf
uses: diegovalenzuelaiturra/[email protected]
with:
args: . --recursive --diff
- name: Fail if yapf made changes
if: steps.yapf.outputs.exit-code == 2
run: exit 1