-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 1018 Bytes
/
pylint.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
name: Lint Code Check
on:
push:
branches:
- main
- '**' # Run on pushes to all branches
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Run pylint
id: pylint
run: |
pylint --rcfile=.pylintrc $(git ls-files '*.py') > pylint_output.txt || true
score=$(tail -n 2 pylint_output.txt | head -n 1 | grep -oP '\d+\.\d+')
echo "Pylint score: $score"
if (( $(echo "$score < 8" | bc -l) )); then
echo "Pylint score is less than 8. Failing the job."
exit 1
fi