Skip to main content

scripts: tidy up the reporting of 100% coverage

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

Changed files

scripts/run_javascript_data_files_tests.sh (431) → scripts/run_javascript_data_files_tests.sh (649)

diff --git a/scripts/run_javascript_data_files_tests.sh b/scripts/run_javascript_data_files_tests.sh
index 36187d1..2d8cec2 100755
--- a/scripts/run_javascript_data_files_tests.sh
+++ b/scripts/run_javascript_data_files_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 'ty check'
 run_command "python3 -m coverage run -m pytest -q tests"
-run_command "python3 -m coverage report"
+report_coverage