-
Notifications
You must be signed in to change notification settings - Fork 203
39 lines (32 loc) · 1.01 KB
/
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
name: Static Analysis
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{format('{0}:{1}:{2}', github.repository, github.ref, github.workflow)}}
cancel-in-progress: true
jobs:
python-linting:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install Python packages
run: |
pip install --upgrade pip
pip install --upgrade flake8
- name: Run flake8 to verify PEP8-compliance of Python code
run: |
# don't check py2vs3/py3.py when testing with Python 2, and vice versa
if [[ "${{ matrix.python-version }}" =~ "2." ]]; then
py_excl=py3
else
py_excl=py2
fi
flake8 --exclude ./easybuild/tools/py2vs3/${py_excl}.py