Skip to content

Commit f25fb3c

Browse files
committed
add score threshold to pylint
1 parent c55af5d commit f25fb3c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/pylint.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ jobs:
2121
pip install pylint
2222
- name: Analysing the code with pylint
2323
run: |
24-
pylint $(git ls-files '*.py')
24+
pylint $(git ls-files '*.py') pylint-report.txt || true
25+
26+
- name: Analyze Pylint Score
27+
id: pylint-score
28+
run: |
29+
SCORE=$(tail -n 2 pylint-report.txt | grep -oE "[0-9]+\.[0-9]+(?=/10)")
30+
echo "Pylint score: $SCORE"
31+
echo "score=$SCORE" >> $GITHUB_ENV
32+
- name: Check Pylint score
33+
run: |
34+
if (( $(echo "$SCORE < 8.0" | bc -l) )); then
35+
echo "Pylint score $SCORE is below the passing threshold of 8.0"
36+
exit 1
37+
fi
38+
env:
39+
SCORE: ${{ env.score }}

0 commit comments

Comments
 (0)