-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 1.04 KB
/
lint.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
name: Code Style
on: [push, pull_request]
jobs:
build:
name: "Lint Code Base"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.1.12
BLACK_VERSION=$(poetry show black | grep version | rev | cut -d " " -f 1 | rev)
FLAKE8_VERSION=$(poetry show flake8 | grep version | rev | cut -d " " -f 1 | rev)
pip install "black==${BLACK_VERSION}" "flake8==${FLAKE8_VERSION}"
- 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
flake8 . --count --max-complexity=10 --max-line-length=88 --statistics
- name: Check with black
run: |
black . --check --diff