Repository navigation
55 lines (52 loc) · 1.72 KB
/
Copy pathlint-python.yml
File metadata and controls
55 lines (52 loc) · 1.72 KB
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
name: "Lint: Python (flake8)"
on:
push:
branches:
- main
paths:
- 'jans-pycloudlib/**'
- 'jans-cli-tui/**'
- 'jans-linux-setup/**'
pull_request:
branches:
- main
paths:
- 'jans-pycloudlib/**'
- 'jans-cli-tui/**'
- 'jans-linux-setup/**'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-projects: [
"jans-pycloudlib",
"jans-cli-tui",
"jans-linux-setup"
]
steps:
- name: Harden Runner
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python 3.10
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
working-directory: ${{ matrix.python-projects }}
- 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 --exclude=jans_setup/setup_app/pylib,jans_setup/static/extension
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=jans_setup/setup_app/pylib,jans_setup/static/extension
working-directory: ${{ matrix.python-projects }}