1
0
mirror of https://github.com/resf/distro-tools.git synced 2024-12-22 02:48:30 +00:00
distro-tools/build/scripts/pylint.bash
2023-02-04 00:37:45 +01:00

16 lines
465 B
Bash
Executable File

#!/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 "===================="