diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-04-22 11:46:07 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-04-23 08:30:37 +0000 |
| commit | 57d54c0889fd10499d368f0132c75567b0a28f57 (patch) | |
| tree | fc7484eefde11175a0e52acc62a77a959aa69d22 | |
| parent | 3b7466b943b5126cb450f32b99d54bfb536e510d (diff) | |
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.
| -rw-r--r-- | pkg/cover/heatmap.go | 2 | ||||
| -rw-r--r-- | 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 @@ </div> {{ end }} <div class="instrumented_column"> - {{ approxInstr $child.Summary }} + <pre>{{ approxInstr $child.Summary }}</pre> </div> </div> {{ if $child.IsDir }} |
