input-remapper/badges.sh

25 lines
679 B
Bash
Raw Normal View History

2020-11-26 20:37:15 +00:00
#!/usr/bin/env bash
coverage_badge() {
# https://github.com/dbrgn/coverage-badge
coverage run --branch --source=/usr/lib/python3.8/site-packages/keymapper tests/test.py
python3 -m coverage_badge > readme/coverage.svg
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() {
# https://github.com/jongracecox/anybadge
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
2020-11-26 20:37:15 +00:00
echo "pylint badge created"
}
pylint_badge &
coverage_badge &
# wait for all badges to be created
wait