Skip to main content

scripts: tidy up the reporting of 100% coverage

ID
acdd733
date
2026-05-13 23:16:52+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
6d798d5
message
scripts: tidy up the reporting of 100% coverage
changed files
1 file, 12 additions, 1 deletion

Changed files

scripts/run_chives_tests.sh (437) → scripts/run_chives_tests.sh (655)

diff --git a/scripts/run_chives_tests.sh b/scripts/run_chives_tests.sh
index 0a1dedc..592d818 100755
--- a/scripts/run_chives_tests.sh
+++ b/scripts/run_chives_tests.sh
@@ -10,6 +10,17 @@ run_command() {
     bash -c "$@"
 }
 
+report_coverage() {
+    echo ""
+    echo -e "\033[34m-> python3 -m coverage report\033[0m"
+    if [[ $(python3 -m coverage report --format=total) = "100" ]]
+    then
+        echo "100% coverage!"
+    else
+        python3 -m coverage
+    fi
+}
+
 run_command 'ruff format'
 
 if [[ "${CI:-}" == "true" ]]
@@ -20,4 +31,4 @@ fi
 run_command 'ruff check'
 run_command 'mypy src tests'
 run_command "python3 -m coverage run -m pytest -q tests"
-run_command "python3 -m coverage report"
+report_coverage