@hublo/sentinel 1.5.0-alpha.15 → 1.5.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/sentinel.js
CHANGED
|
@@ -5301,11 +5301,21 @@ function renderHtml(report) {
|
|
|
5301
5301
|
const rest = sorted.length - listed.length;
|
|
5302
5302
|
const columns = columnsFor(metric, all2);
|
|
5303
5303
|
const head = columns.map((column) => `<th scope="col">${column.header}</th>`).join("");
|
|
5304
|
-
const rows2 = listed.map(
|
|
5305
|
-
(
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5304
|
+
const rows2 = listed.map((finding) => {
|
|
5305
|
+
const cells = columns.map((column) => ` <td>${column.cell(finding)}</td>`).join("\n");
|
|
5306
|
+
const code = finding.excerpt ? `
|
|
5307
|
+
<tr class="excerpt">
|
|
5308
|
+
<td colspan="${columns.length}">
|
|
5309
|
+
<details>
|
|
5310
|
+
<summary>${finding.lines ?? ""} duplicated lines</summary>
|
|
5311
|
+
<pre><code>${escape(finding.excerpt)}</code></pre>
|
|
5312
|
+
</details>
|
|
5313
|
+
</td>
|
|
5314
|
+
</tr>` : "";
|
|
5315
|
+
return ` <tr>
|
|
5316
|
+
${cells}
|
|
5317
|
+
</tr>${code}`;
|
|
5318
|
+
}).join("\n");
|
|
5309
5319
|
return `
|
|
5310
5320
|
<h2>${escape(label)} · where to look</h2>
|
|
5311
5321
|
<section>
|
|
@@ -5441,6 +5451,17 @@ ${rest > 0 ? ` <p class="sub">The ${HTML_GROUP_LIMIT} longest are listed; ${r
|
|
|
5441
5451
|
details p b { color: var(--ink); font-weight: 600; }
|
|
5442
5452
|
details p { margin: 0 0 0.7rem; padding: 0 0.6rem; color: var(--ink-soft); font-size: 0.88rem; max-width: 52rem; }
|
|
5443
5453
|
details p.source { color: var(--label); font-size: 0.8rem; }
|
|
5454
|
+
/* The duplicated code, under the row that located it. */
|
|
5455
|
+
tr.excerpt td { padding: 0 0.6rem 0.4rem; border-bottom: 1px solid var(--rule); }
|
|
5456
|
+
tr.excerpt details { border: 0; }
|
|
5457
|
+
tr.excerpt summary { padding: 0.35rem 0; font-size: 0.8rem; color: var(--label); font-weight: 400; }
|
|
5458
|
+
tr.excerpt summary:hover { color: var(--brand); }
|
|
5459
|
+
tr.excerpt pre {
|
|
5460
|
+
margin: 0 0 0.5rem; padding: 0.7rem 0.9rem; background: var(--page);
|
|
5461
|
+
border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto;
|
|
5462
|
+
font: 0.8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre;
|
|
5463
|
+
}
|
|
5464
|
+
tr.excerpt pre code { color: var(--ink); font-size: 1em; }
|
|
5444
5465
|
footer { color: var(--label); font-size: 0.78rem; margin-top: 2.5rem; }
|
|
5445
5466
|
@media (max-width: 40rem) {
|
|
5446
5467
|
section { padding: 0.25rem 0.6rem; }
|
|
@@ -5872,7 +5893,8 @@ function placesToLook(product, tests, dead, complexity) {
|
|
|
5872
5893
|
metric,
|
|
5873
5894
|
path: at(entry.firstFile),
|
|
5874
5895
|
other: at(entry.secondFile),
|
|
5875
|
-
...entry.lines === void 0 ? {} : { lines: entry.lines }
|
|
5896
|
+
...entry.lines === void 0 ? {} : { lines: entry.lines },
|
|
5897
|
+
...entry.fragment ? { excerpt: entry.fragment } : {}
|
|
5876
5898
|
})) : [];
|
|
5877
5899
|
const deadMetric = {
|
|
5878
5900
|
"unused-file": "unusedFiles",
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hublo/sentinel",
|
|
3
|
-
"version": "1.5.0-alpha.
|
|
3
|
+
"version": "1.5.0-alpha.16",
|
|
4
4
|
"description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|