Skip to content

Commit 9800355

Browse files
committed
Styling on coverage reports
1 parent dd9db44 commit 9800355

File tree

8 files changed

+1015
-987
lines changed

8 files changed

+1015
-987
lines changed

coverage/ansi.luau.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
33
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
44
<style>
5-
body { font-family: monospace; font-size: 16px; }
5+
body { font-family: monospace; text-align: center; }
6+
#funcTable table { margin: 0 auto; width: auto; max-width: 300px; font-size: 14px; border-collapse: collapse; }
7+
#funcTable th, #funcTable td { padding: 2px 6px; text-align: left; white-space: nowrap; }
8+
#funcTable th { background-color: #ddd; }
9+
#funcTable td:nth-child(2) { text-align: right; min-width: 50px; }
610
.zero-hits { background-color: #fcc; font-weight: bold; color: red; }
711
.nonzero-hits { color: green; font-weight: bold; }
812
.low-hits { background-color: #ffe6b3; }
913
.high-hits { background-color: #cfc; }
10-
th, td { padding: 0px; font-size: 12px; }
14+
.source-code-table { margin-left: 10px; }th, td { padding: 0px; font-size: 12px; }
1115
table.table { font-size: 14px; border-collapse: collapse; }
1216
table.table th, table.table td { padding: 1px; font-size: 12px; line-height: 1.2; }
1317
table.table tr { height: auto; }
@@ -28,7 +32,7 @@ <h2>Function Coverage:</h2><table class="table table-bordered"><thead><tr><th>Fu
2832
<tr><td style="padding: 1px; min-width: 18ch;">green_highlight:26</td><td style="padding: 1px; color: red; font-weight: bold;">0</td></tr>
2933
<tr><td style="padding: 1px; min-width: 18ch;">gray:30</td><td style="padding: 1px; color: red; font-weight: bold;">0</td></tr>
3034
</tbody></table></div>
31-
<h2>Source Code:</h2><table class="table table-bordered"><thead><tr><th>Line</th><th>Hits</th><th>Code</th></tr></thead><tbody>
35+
<h2>Source Code:</h2><table class="table table-bordered source-code-table "><thead><tr><th>Line</th><th>Hits</th><th>Code</th></tr></thead><tbody>
3236
<tr><td>1</td><td>1</td><td><span class=high-hits>return {</span></td></tr>
3337
<tr><td>2</td><td>1</td><td><span class=high-hits>white_underline = function(s: any)</span></td></tr>
3438
<tr><td>3</td><td>0</td><td><span class=zero-hits>return `\27[1;4m{s}\27[0m`</span></td></tr>

coverage/entity_visualiser.luau.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
33
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
44
<style>
5-
body { font-family: monospace; font-size: 16px; }
5+
body { font-family: monospace; text-align: center; }
6+
#funcTable table { margin: 0 auto; width: auto; max-width: 300px; font-size: 14px; border-collapse: collapse; }
7+
#funcTable th, #funcTable td { padding: 2px 6px; text-align: left; white-space: nowrap; }
8+
#funcTable th { background-color: #ddd; }
9+
#funcTable td:nth-child(2) { text-align: right; min-width: 50px; }
610
.zero-hits { background-color: #fcc; font-weight: bold; color: red; }
711
.nonzero-hits { color: green; font-weight: bold; }
812
.low-hits { background-color: #ffe6b3; }
913
.high-hits { background-color: #cfc; }
10-
th, td { padding: 0px; font-size: 12px; }
14+
.source-code-table { margin-left: 10px; }th, td { padding: 0px; font-size: 12px; }
1115
table.table { font-size: 14px; border-collapse: collapse; }
1216
table.table th, table.table td { padding: 1px; font-size: 12px; line-height: 1.2; }
1317
table.table tr { height: auto; }
@@ -23,7 +27,7 @@ <h2>Function Coverage:</h2><table class="table table-bordered"><thead><tr><th>Fu
2327
<tr><td style="padding: 1px; min-width: 13ch;">name:11</td><td style="padding: 1px; color: red; font-weight: bold;">0</td></tr>
2428
<tr><td style="padding: 1px; min-width: 13ch;">components:15</td><td style="padding: 1px; color: red; font-weight: bold;">0</td></tr>
2529
</tbody></table></div>
26-
<h2>Source Code:</h2><table class="table table-bordered"><thead><tr><th>Line</th><th>Hits</th><th>Code</th></tr></thead><tbody>
30+
<h2>Source Code:</h2><table class="table table-bordered source-code-table "><thead><tr><th>Line</th><th>Hits</th><th>Code</th></tr></thead><tbody>
2731
<tr><td>1</td><td>1</td><td><span class=high-hits>local jecs = require("@jecs")</span></td></tr>
2832
<tr><td>2</td><td>1</td><td><span class=high-hits>local ECS_GENERATION = jecs.ECS_GENERATION</span></td></tr>
2933
<tr><td>3</td><td>1</td><td><span class=high-hits>local ECS_ID = jecs.ECS_ID</span></td></tr>

coverage/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
</head><body>
44
<h1 class="text-center">Coverage Report</h1>
55
<table class="table table-striped table-bordered"><thead><tr><th>File</th><th>Total Hits</th><th>Functions</th></tr></thead><tbody>
6-
<tr><td><a href="tests.luau.html">tests.luau</a></td><td>72</td><td>67</td></tr>
7-
<tr><td><a href="jecs.luau.html">jecs.luau</a></td><td>161937</td><td>98</td></tr>
8-
<tr><td><a href="testkit.luau.html">testkit.luau</a></td><td>615</td><td>31</td></tr>
6+
<tr><td><a href="tests.luau.html">tests.luau</a></td><td>100</td><td>67</td></tr>
7+
<tr><td><a href="jecs.luau.html">jecs.luau</a></td><td>1006447</td><td>97</td></tr>
8+
<tr><td><a href="testkit.luau.html">testkit.luau</a></td><td>1826</td><td>31</td></tr>
99
<tr><td><a href="lifetime_tracker.luau.html">lifetime_tracker.luau</a></td><td>1</td><td>11</td></tr>
1010
<tr><td><a href="entity_visualiser.luau.html">entity_visualiser.luau</a></td><td>1</td><td>4</td></tr>
1111
<tr><td><a href="ansi.luau.html">ansi.luau</a></td><td>1</td><td>9</td></tr>

0 commit comments

Comments
 (0)