Skip to content

Commit 8449e1d

Browse files
committed
add new pipeline
1 parent a2349e5 commit 8449e1d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/pylint.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Pylint
2-
31
on: [push]
42

53
jobs:
@@ -20,4 +18,13 @@ jobs:
2018
pip install pylint
2119
pip install -r requirements.txt
2220
- name: Analysing the code with pylint
23-
run: pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py scrapegraphai/*.py
21+
run: pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py scrapegraphai/*.py
22+
- name: Check Pylint score
23+
run: |
24+
pylint_score=$(pylint --disable=all --enable=metrics --output-format=text scrapegraphai/**/*.py scrapegraphai/*.py | grep 'Raw metrics' | awk '{print $4}')
25+
if (( $(echo "$pylint_score < 8" | bc -l) )); then
26+
echo "Pylint score is below 8. Blocking commit."
27+
exit 1
28+
else
29+
echo "Pylint score is acceptable."
30+
fi

0 commit comments

Comments
 (0)