-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1010 Bytes
/
pylint.yml
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
name: Pylint Check
on:
pull_request:
branches:
- dev
- main
workflow_dispatch:
jobs:
pylint:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install pylint
run: pip install pylint
- name: Run pylint
env:
GH_TOKEN: ${{ github.token }}
run: |
export PYLINT_SCORE=$(pylint src/ | grep 'Your code has been rated at' | awk '{print $7}' | cut -d '/' -f 1)
if (( $(echo "$PYLINT_SCORE < 9.5" | bc -l) )); then
echo "Pylint score is too low: $PYLINT_SCORE. Minimum required: 9.5"
gh pr comment \
${{ github.event.pull_request.number }} \
--body "$(envsubst < .github/not_enough_pylint_score.md)"
exit 1
else
echo "Pylint score is $PYLINT_SCORE. Passed!"
fi