-
-
Notifications
You must be signed in to change notification settings - Fork 14
37 lines (35 loc) · 1.15 KB
/
Copy pathpylint.yaml
File metadata and controls
37 lines (35 loc) · 1.15 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
name: Pylint
on:
push:
pull_request:
branches: ["develop"]
jobs:
pylint_check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint astroid pytest
pip install -r requirements.txt
sudo apt-get update && sudo apt-get install -y bc # Install bc
- name: Analysing the code with pylint
run: |
pylint_output=$(pylint $(git ls-files '*.py') --output-format=parseable | tee pylint.log)
echo "$pylint_output"
SCORE=$(echo "$pylint_output" | awk -F ' ' '/Your code has been rated at/ {print $7}' | cut -d'/' -f1)
if (( $(echo "$SCORE >= 9.0" | bc -l) )); then
echo "Pylint score ($SCORE) is acceptable."
exit 0
else
echo "Pylint score ($SCORE) is too low."
exit 1
fi