-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (47 loc) · 1.39 KB
/
lint.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: Lint
on:
push:
paths:
- 'superblockify/**.py'
- 'tests/**.py'
jobs:
run-black:
name: Run Black codestyle
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Run Black
uses: psf/black@stable
with:
src: './superblockify ./tests ./scripts'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix code style issues with Black
commit_user_name: ${{ github.actor }}
commit_user_email: ${{ github.actor }}@users.noreply.github.com
run-pylint:
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
name: Run Pylint code analyzer
needs: run-black
runs-on: ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pylint
run: pip install pylint
- name: Lint Source Code
run: pylint -d E0401 superblockify/
# ignore import-errors first, analyze later with tests in anaconda environment
- name: Lint Tests
run: pylint -d E0401 -d R0801 tests/
# also ignore code repetition in tests