-
Notifications
You must be signed in to change notification settings - Fork 22
35 lines (32 loc) · 1.14 KB
/
lint_python_flake8.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
name: Lint Python with flake8
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
name: Lint Python with flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Ubuntu packages
run: |
sudo apt install -y python3-pip
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install flake8
# pip install wemake-python-styleguide # disabled as way too strict
- 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
# E203: Spaces around colons in array indexing collides with black-formatting
# E402: Imports always on top collide with the need to set the python module search path in some places
# W503: Collides with black formatting
flake8 . --count --max-complexity=10 --max-line-length=200 --statistics --ignore=E203,E402,W503