mirror of
https://github.com/resf/distro-tools.git
synced 2024-12-01 01:16:25 +00:00
16 lines
465 B
Bash
16 lines
465 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
shopt -s globstar
|
||
|
|
||
|
python3 -m pylint --rcfile=.pylintrc --ignore-patterns "re.compile(r'bazel-.*|node-modules|.venv')" **/*.py -v | tee /tmp/pytest.txt
|
||
|
score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pytest.txt)
|
||
|
|
||
|
echo "===================="
|
||
|
if (( $(echo "$score < 9.0" | bc -l) )); then
|
||
|
echo "Pylint score is too low: $score"
|
||
|
exit 1
|
||
|
else
|
||
|
echo "Pylint score is good: $score"
|
||
|
fi
|
||
|
echo "===================="
|