input-remapper/scripts/badges.sh

32 lines
797 B
Bash
Raw Normal View History

2020-11-26 20:37:15 +00:00
#!/usr/bin/env bash
2020-12-06 14:16:25 +00:00
# sudo pip install git+https://github.com/jongracecox/anybadge
2020-11-26 20:37:15 +00:00
coverage_badge() {
2020-12-01 23:02:41 +00:00
coverage run tests/test.py
2020-11-30 18:02:57 +00:00
coverage combine
2020-12-20 17:19:33 +00:00
rating=$(coverage report | tail -n 1 | ack "\d+%" -o | ack "\d+" -o)
2022-06-25 10:23:56 +00:00
echo "coverage rating: $rating"
2020-12-20 17:19:33 +00:00
rm readme/coverage.svg
anybadge -l coverage -v $rating -f readme/coverage.svg coverage
2020-11-26 23:42:44 +00:00
coverage report -m
2020-11-26 20:37:15 +00:00
echo "coverage badge created"
}
pylint_badge() {
2022-01-01 12:00:49 +00:00
pylint_output=$(pylint inputremapper --extension-pkg-whitelist=evdev)
2020-11-26 20:37:15 +00:00
rating=$(echo $pylint_output | grep -Po "rated at .+?/" | grep -Po "\d+.\d+")
rm readme/pylint.svg
anybadge -l pylint -v $rating -f readme/pylint.svg pylint
2020-12-20 17:19:33 +00:00
2022-06-25 10:23:56 +00:00
echo "pylint rating: $rating"
2020-11-26 20:37:15 +00:00
echo "pylint badge created"
}
pylint_badge &
coverage_badge &
# wait for all badges to be created
wait