You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
input-remapper/scripts/badges.sh

31 lines
742 B
Bash

4 years ago
#!/usr/bin/env bash
4 years ago
# sudo pip install git+https://github.com/jongracecox/anybadge
4 years ago
coverage_badge() {
4 years ago
coverage run tests/test.py
coverage combine
4 years ago
rating=$(coverage report | tail -n 1 | ack "\d+%" -o | ack "\d+" -o)
rm readme/coverage.svg
anybadge -l coverage -v $rating -f readme/coverage.svg coverage
coverage report -m
4 years ago
echo "coverage badge created"
}
pylint_badge() {
pylint_output=$(pylint keymapper --extension-pkg-whitelist=evdev)
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
4 years ago
4 years ago
echo $rating
4 years ago
echo "pylint badge created"
}
pylint_badge &
coverage_badge &
# wait for all badges to be created
wait