-
-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (69 loc) · 3.18 KB
/
flake.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: "Flake & Black check"
on:
push:
branches: [main]
paths-ignore:
- ".github/**"
pull_request:
branches: [main]
permissions:
contents: read
jobs:
validate_flake8:
name: "flake8"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: |
3.11
check-latest: true
allow-prereleases: true
- name: Install flake8 + black
run: |
pip install --require-hashes -r ./.github/workflows/config/requirements_format.txt
- name: formatting with black
run: |
black --line-length=127 --check .
- name: Install flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --ignore=E501,E266,E202,E201,E301
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --ignore=E501,E266,E202,E201,E301
- name: Check for fatal errors
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Docstrings
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=D,DAR
- name: Small tweaks that might help, but might conflict or be inconvenient
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=WPS323,WPS336,WPS305,WPS420,WPS440,WPS441,WPS515,E800\:,WPS421,W503,WPS412
- name: Trailing commas and isort
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=I,C81
- name: Overcomplex code
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=WPS201,WPS210,WPS214,WPS221,WPS229,WPS226
- name: Useless stuff
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=F401,F841,WPS327,WPS503,WPS504,WPS507
- name: Bandit
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=S
- name: Clarity and quality improvements
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics --select=WPS432,WPS110,WPS111,WPS322,E501
- name: General stats
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics \
--ignore=D,DAR,WPS323,WPS336,WPS305,WPS420,WPS440,WPS441,WPS515,E800\:,WPS421,W503,WPS412,I,C81,WPS201,WPS210,WPS214,WPS221,WPS229,WPS226,F401,F841,WPS327,WPS503,WPS504,WPS507,S,WPS432,WPS110,WPS111,WPS322,E501