-
Notifications
You must be signed in to change notification settings - Fork 20
69 lines (58 loc) · 2.18 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
60
61
62
63
64
65
66
67
68
name: Linting
on:
push:
branches: '**'
pull_request:
branches: ['main', 'dev']
permissions:
checks: write
contents: write
jobs:
lint:
name: Run linter
runs-on: [ 'ubuntu-latest' ]
env:
AGENT_TOOLSDIRECTORY: /home/runner/actions-runner/_work/_tool/
defaults:
run:
shell: bash -el {0}
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.7'
token: ${{ secrets.QUARK_GH_GITHUB_COM_TOKEN }}
- name: Install pylint and autopep8
run: pip install pylint autopep8
- name: Disable Git LFS locking
run: git config lfs.https://github.com/QUARK-framework/QUARK.git/info/lfs.locksverify false
- name: Run autopep8 (fix PEP8 issues automatically)
run: autopep8 --in-place --recursive --aggressive --max-line-length 120 -v .
- name: Clean the workspace
if: github.event_name == 'pull_request'
run: git reset --hard
- name: Commit changes if any
if: github.event_name == 'push'
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Apply autopep8 formatting"
git push origin HEAD:${{ github.ref }}
fi
- name: Run pylint
uses: wearerequired/lint-action@v2
with:
pylint: true
pylint_args: "--max-line-length=120 --max-attributes=10 --max-args=8 --disable=C0111 --disable=W1514
--disable=logging-fstring-interpolation --disable=import-error --disable=C0103 --disable=W0718
--disable=W0719 --disable=R1705 --disable=W0107 --disable=W0613 --disable=W0401 --disable=W0614
--disable=W0611 --disable=C0123 --disable=C0413 --disable=W0511 --disable=R1702 --disable=R0912
--disable=R0914 --disable=R0911 --disable=R0801"