1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
Files
checktheroads-hyperglass/ci/check_code.sh

32 lines
690 B
Bash
Raw Normal View History

2019-06-16 16:02:33 -07:00
#!/bin/bash
setup_git() {
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
}
check_format() {
black hyperglass
git add hyperglass/ *.py
git commit --message "Black Formatting - travis #$TRAVIS_BUILD_NUMBER"
2019-06-16 16:04:00 -07:00
echo "Completed Black Formatting"
2019-06-16 16:02:33 -07:00
}
run_pylint() {
2019-06-16 17:13:02 -07:00
echo $(python3 manage.py pylint-badge --integer-only True)
2019-06-16 16:02:33 -07:00
}
check_pylint() {
PYLINT_SCORE=$(run_pylint)
2019-06-16 16:05:53 -07:00
echo "Pylint score: $PYLINT_SCORE"
2019-06-16 17:13:02 -07:00
if [ "$PYLINT_SCORE" == "10.00" ]
2019-06-16 16:02:33 -07:00
then
git add pylint.svg
git commit --message "Pylint Badge - travis #$TRAVIS_BUILD_NUMBER"
2019-06-16 16:04:00 -07:00
echo "Completed Pylint Check & Badge Creation"
2019-06-16 16:02:33 -07:00
fi
}
check_format
check_pylint