2020-11-26 22:34:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-12-06 14:16:25 +00:00
|
|
|
# sudo pip install git+https://github.com/jongracecox/anybadge
|
|
|
|
# sudo pip install git+https://github.com/dbrgn/coverage-badge
|
|
|
|
|
2020-11-26 22:34:52 +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-01 23:14:02 +00:00
|
|
|
python3 -m coverage_badge > readme/coverage.svg
|
2020-11-26 23:42:44 +00:00
|
|
|
coverage report -m
|
2020-11-26 22:34:52 +00:00
|
|
|
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+")
|
2020-11-26 23:39:36 +00:00
|
|
|
rm readme/pylint.svg
|
2020-11-26 23:36:19 +00:00
|
|
|
anybadge -l pylint -v $rating -f readme/pylint.svg pylint
|
2020-11-28 17:44:54 +00:00
|
|
|
echo $rating
|
2020-11-26 22:34:52 +00:00
|
|
|
echo "pylint badge created"
|
|
|
|
}
|
|
|
|
|
|
|
|
pylint_badge &
|
|
|
|
coverage_badge &
|
|
|
|
|
|
|
|
# wait for all badges to be created
|
2020-11-26 23:39:36 +00:00
|
|
|
wait
|