Skip to content

Commit

Permalink
add score threshold to pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
sbartlett97 committed Dec 5, 2024
1 parent c55af5d commit f25fb3c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,19 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
pylint $(git ls-files '*.py') pylint-report.txt || true
- name: Analyze Pylint Score
id: pylint-score
run: |
SCORE=$(tail -n 2 pylint-report.txt | grep -oE "[0-9]+\.[0-9]+(?=/10)")
echo "Pylint score: $SCORE"
echo "score=$SCORE" >> $GITHUB_ENV
- name: Check Pylint score
run: |
if (( $(echo "$SCORE < 8.0" | bc -l) )); then
echo "Pylint score $SCORE is below the passing threshold of 8.0"
exit 1
fi
env:
SCORE: ${{ env.score }}

0 comments on commit f25fb3c

Please sign in to comment.