From 57d54c0889fd10499d368f0132c75567b0a28f57 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 22 Apr 2025 11:46:07 +0200 Subject: pkg/cover: use space for alignment, not underscore Pre tag is used to save formatting space. Pre uses monospace font, thus changed all the file-tree to monospace. Pre also adds margin. Forcing margin to 0 manually. --- pkg/cover/heatmap.go | 2 +- pkg/cover/templates/heatmap.html | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/cover/heatmap.go b/pkg/cover/heatmap.go index 751b53ea6..419a9a500 100644 --- a/pkg/cover/heatmap.go +++ b/pkg/cover/heatmap.go @@ -294,7 +294,7 @@ func FormatResult(thm *templateHeatmap, format Format) { } func approximateInstrumented(points int64) string { - dim := "_" + dim := " " if abs(points) > 10000 { dim = "K" points /= 1000 diff --git a/pkg/cover/templates/heatmap.html b/pkg/cover/templates/heatmap.html index 281fe84ef..3f2028705 100644 --- a/pkg/cover/templates/heatmap.html +++ b/pkg/cover/templates/heatmap.html @@ -33,6 +33,9 @@ width: 50px; text-align: right; } + .instrumented_column > pre { + margin: 0 + } .tree_depth_0 {width: 0px;} .tree_depth_1 {width: 20px;} .tree_depth_2 {width: 40px;} @@ -101,6 +104,9 @@ .cover_percent:hover .tooltiptext { visibility: visible; } + #collapsible-list { + font-family: monospace; + } {{ end }} {{ define "body" }} @@ -215,7 +221,7 @@ {{ end }}
- {{ approxInstr $child.Summary }} +
{{ approxInstr $child.Summary }}
{{ if $child.IsDir }} -- cgit mrf-deployment