-
Notifications
You must be signed in to change notification settings - Fork 67
34 lines (30 loc) · 1.08 KB
/
flake8.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: flake8
# since we're only checking PR diffs, only trigger on the pull_request event type.
# note: the pull_request event happens on opened, reopened, and synchronize activities;
# synchronize includes commits being pushed to the PR branch.
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#pull_request
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all branches, needed so we can diff against the target branch
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install flake8
run: |
python -m pip install --upgrade pip
pip install flake8
- name: List changed files
run: |
git diff --compact-summary "origin/$GITHUB_BASE_REF"
- name: Run linter
run: |
flake8 . --config=.flake8 --count --statistics --show-source