Skip to content

Commit 1c82d63

Browse files
authored
Update pylint2.yml
1 parent c06b1aa commit 1c82d63

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

.github/workflows/pylint2.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
11
name: Pylint
2-
32
on: [push, pull_request]
4-
53
jobs:
64
pylint:
75
runs-on: ubuntu-latest
86
strategy:
97
matrix:
10-
# === FIX 1: Only list Python versions you actually support ===
11-
python-version: ["3.10", "3.11", "3.12"] # Added 3.12 as well, as you support it
12-
8+
python-version: ["3.10", "3.11", "3.12"]
139
steps:
1410
- uses: actions/checkout@v4
15-
1611
- name: Set up Python ${{ matrix.python-version }}
1712
uses: actions/setup-python@v4
1813
with:
1914
python-version: ${{ matrix.python-version }}
20-
2115
- name: Install dependencies
2216
run: |
2317
python -m pip install --upgrade pip
2418
# Install your project dependencies
2519
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2620
pip install pylint
27-
2821
- name: Analysing the code with pylint
2922
run: |
30-
# === FIX 2: Make the check meaningful. Fail if the score is below 9/10 ===
31-
# This will make the workflow fail if code quality drops.
32-
find . -type f -name "*.py" | xargs pylint --fail-under=9
33-
34-
- name: Generate pylint report (only if analysis fails)
35-
# This step will only run if the previous step failed, so you can see the report
36-
if: failure()
37-
run: |
23+
# Generate pylint report and always succeed (|| true prevents failure)
3824
find . -type f -name "*.py" | xargs pylint --output-format=text --reports=yes > pylint-report.txt || true
39-
40-
- name: Upload pylint report (only if analysis fails)
41-
if: failure()
25+
echo "Pylint analysis completed. Check the report for details."
26+
- name: Display pylint score
27+
run: |
28+
echo "=== PYLINT REPORT SUMMARY ==="
29+
if [ -f pylint-report.txt ]; then
30+
# Extract and display the score line
31+
grep -E "Your code has been rated at" pylint-report.txt || echo "Score line not found"
32+
echo "Full report available in artifacts"
33+
else
34+
echo "No report file generated"
35+
fi
36+
- name: Upload pylint report
4237
uses: actions/upload-artifact@v4
4338
with:
4439
name: pylint-report-${{ matrix.python-version }}

0 commit comments

Comments
 (0)