From 7dcd8cccc22b7bae11938df322a9eb1156b35007 Mon Sep 17 00:00:00 2001 From: officiallyanee Date: Sat, 5 Dec 2026 00:52:53 +0530 Subject: [PATCH] build: fix LaTeX color rendering and percent escaping in coverage reports --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: skipped - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .github/workflows/scripts/run_tests_coverage/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/run_tests_coverage/run b/.github/workflows/scripts/run_tests_coverage/run index 48042ecec212..e188796d38d0 100755 --- a/.github/workflows/scripts/run_tests_coverage/run +++ b/.github/workflows/scripts/run_tests_coverage/run @@ -106,7 +106,7 @@ compare_cov() { new_cov_value="$2" if [ "$old_cov_value" == 0 ]; then - awk "BEGIN {printf \"\$\\\\\\\\\\\\\\\\color{green}+%.2f\\\\\\\\\\\\\\\\%%\$\n\", $new_cov_value*100}" + awk "BEGIN {printf \"\$\\\\color{green}+%.2f\\\\\\\\%%\$\n\", $new_cov_value*100}" else percentage_change=$(awk "BEGIN {printf \"%.2f\", (($new_cov_value - $old_cov_value) / $old_cov_value) * 100}") color="green" @@ -115,7 +115,7 @@ compare_cov() { color="red" sign="" fi - awk "BEGIN {print \"\$\\\\\\\\\\\\\\\\color{$color}${sign}${percentage_change}\\\\\\\\\\\\\\\\%\$\"}" + awk "BEGIN {print \"\$\\\\color{$color}${sign}${percentage_change}\\\\\\\\%\$\"}" fi } @@ -162,7 +162,7 @@ main() { pkg_functions_cov=${pkg_cov_values[2]} pkg_lines_cov=${pkg_cov_values[3]} - pkg_cov_fractions=($(cat $coverage_path | grep "fraction" | grep -oP '\d+/\d+' | awk -F'/' '{if ($1<$2) print "$\\\\\\\\color{red}" $0 "$"; else print "$\\\\\\\\color{green}" $0 "$"}')) + pkg_cov_fractions=($(cat $coverage_path | grep "fraction" | grep -oP '\d+/\d+' | awk -F'/' '{if ($1<$2) print "$\\color{red}" $0 "$"; else print "$\\color{green}" $0 "$"}')) pkg_statements_cov_fraction=${pkg_cov_fractions[0]} pkg_branches_cov_fraction=${pkg_cov_fractions[1]} pkg_functions_cov_fraction=${pkg_cov_fractions[2]}