-
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (40 loc) · 1.45 KB
/
Copy pathpylint.yml
File metadata and controls
40 lines (40 loc) · 1.45 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
38
39
40
name: Pylint
on: [push, pull_request]
jobs:
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install your project dependencies
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pylint
- name: Analysing the code with pylint
run: |
# Generate pylint report and always succeed (|| true prevents failure)
find . -type f -name "*.py" | xargs pylint --output-format=text --reports=yes > pylint-report.txt || true
echo "Pylint analysis completed. Check the report for details."
- name: Display pylint score
run: |
echo "=== PYLINT REPORT SUMMARY ==="
if [ -f pylint-report.txt ]; then
# Extract and display the score line
grep -E "Your code has been rated at" pylint-report.txt || echo "Score line not found"
echo "Full report available in artifacts"
else
echo "No report file generated"
fi
- name: Upload pylint report
uses: actions/upload-artifact@v4
with:
name: pylint-report-${{ matrix.python-version }}
path: pylint-report.txt