Skip to content

Commit cc84c49

Browse files
committed
build: update escaping in coverage report output
--- 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: passed - 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: passed - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 546f9ba commit cc84c49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/scripts/run_tests_coverage

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ compare_cov() {
108108
new_cov_value="$2"
109109

110110
if [ "$old_cov_value" == 0 ]; then
111-
awk "BEGIN {printf \"\$\\\\\\\\color{green}+%.2f\\\\\\\\%%\$\n\", $new_cov_value*100}"
111+
awk "BEGIN {printf \"\$\\\\\\\\\\\\\\\\color{green}+%.2f\\\\\\\\\\\\\\\\%%\$\n\", $new_cov_value*100}"
112112
else
113113
percentage_change=$(awk "BEGIN {printf \"%.2f\", (($new_cov_value - $old_cov_value) / $old_cov_value) * 100}")
114114
color="green"
@@ -117,7 +117,7 @@ compare_cov() {
117117
color="red"
118118
sign=""
119119
fi
120-
awk "BEGIN {print \"\$\\\\\\\\color{$color}${sign}${percentage_change}\\\\\\\\%\$\"}"
120+
awk "BEGIN {print \"\$\\\\\\\\\\\\\\\\color{$color}${sign}${percentage_change}\\\\\\\\\\\\\\\\%\$\"}"
121121
fi
122122
}
123123

@@ -159,7 +159,7 @@ main() {
159159
pkg_functions_cov=${pkg_cov_values[2]}
160160
pkg_lines_cov=${pkg_cov_values[3]}
161161

162-
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 "$"}'))
162+
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 "$"}'))
163163
pkg_statements_cov_fraction=${pkg_cov_fractions[0]}
164164
pkg_branches_cov_fraction=${pkg_cov_fractions[1]}
165165
pkg_functions_cov_fraction=${pkg_cov_fractions[2]}

0 commit comments

Comments
 (0)