-
-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (55 loc) · 1.43 KB
/
python_linting.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Python Linting
on:
workflow_dispatch:
pull_request:
push:
branches:
- "master"
paths:
- "**/*"
- "!.github/**" # exclude PRs related to .github from auto-run
- "!.github/workflows/**" # exclude PRs related to .github from auto-run
jobs:
check_paths:
runs-on: ubuntu-latest
outputs:
githubfolder: ${{ steps.filter.outputs.githubfolder }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Filter paths
uses: dorny/[email protected]
id: filter
with:
filters: |
githubfolder:
- '.github/**'
lint:
needs: check_paths
if: needs.check_paths.outputs.githubfolder == 'false' || github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Python
uses: actions/setup-python@v5
-
name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install pylint
pip install -r src/requirements.txt
-
name: Lint with flake8
run: |
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src --count --max-complexity=10 --max-line-length=120 --statistics
-
name: Lint with Pylint
run: |
pylint src