Skip to content

Commit

Permalink
ci: add flake8 lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Jul 27, 2020
1 parent 01211f4 commit 75d8e91
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
select = B,C,E,F,W
ignore = E203, W503
27 changes: 21 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Cache pip requirements
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python3.8-pip-${{ hashfiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-python3.8-pip-
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
Expand All @@ -31,20 +31,35 @@ jobs:
black ./
isort --check ./
git diff --exit-code
flake8:
name: Lint with Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install requirements
run: |
python -m pip install -U .[lint]
- name: Lint with Flake8
run: |
python -m flake8
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip requirements
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python3.7-pip-${{ hashfiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-python3.7-pip-
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
Expand All @@ -68,14 +83,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Cache pip requirements
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python${{ matrix.python-version }}-pip-${{ hashfiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-python${{ matrix.python-version }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ docs =
sphinx>=3.1.2,<3.2.0
sphinxcontrib-trio==1.1.2
sphinx_rtd_theme>=0.5.0,<0.6.0
lint =
flake8>=3.8.3,<4.0.0
style =
black==19.10b0
isort==5.2.0
Expand Down

0 comments on commit 75d8e91

Please sign in to comment.