@hublo/sentinel 1.5.0-alpha.11 → 1.5.0-alpha.12

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.
@@ -15,7 +15,7 @@ import {
15
15
  palette,
16
16
  registerAdapters,
17
17
  resolve
18
- } from "../chunk-SXIZBKVJ.js";
18
+ } from "../chunk-RH7TOWSN.js";
19
19
  import {
20
20
  resolveContext
21
21
  } from "../chunk-KLEXJFJ6.js";
@@ -4865,6 +4865,14 @@ function helpFor(key) {
4865
4865
 
4866
4866
  // src/roles/static-analysis/report.ts
4867
4867
  var SCRIPTS = { json: "static-analysis:json", html: "static-analysis:html" };
4868
+ function secondSide(finding) {
4869
+ if (!finding.other) return "";
4870
+ const file = (at) => at.split(":")[0] ?? at;
4871
+ const sameFile = file(finding.other) === file(finding.path);
4872
+ const label = sameFile ? "and line" : "and";
4873
+ const shownSide = sameFile ? finding.other.split(":")[1] ?? finding.other : finding.other;
4874
+ return ` <span class="unit">${label}</span> <code>${escape(shownSide)}</code>`;
4875
+ }
4868
4876
  var HTML_GROUP_LIMIT = 50;
4869
4877
  function shown(row) {
4870
4878
  return row.unit === "%" && typeof row.value === "number" ? row.value.toFixed(2) : String(row.value);
@@ -4958,7 +4966,7 @@ function renderHtml(report) {
4958
4966
  const rest = sorted.length - shown2.length;
4959
4967
  const rows2 = shown2.map(
4960
4968
  (finding) => ` <tr>
4961
- <td><code>${escape(finding.path)}</code>${finding.other ? ` <span class="unit">and</span> <code>${escape(finding.other)}</code>` : ""}</td>
4969
+ <td><code>${escape(finding.path)}</code>${secondSide(finding)}</td>
4962
4970
  <td>${finding.name ? `<code>${escape(finding.name)}</code>` : ""}</td>
4963
4971
  <td class="num">${finding.lines ?? ""}</td>
4964
4972
  <td class="num">${finding.confidence ?? ""}</td>
@@ -5494,11 +5502,12 @@ function safeParse(text) {
5494
5502
  }
5495
5503
  }
5496
5504
  function placesToLook(product, tests, dead) {
5505
+ const at = (side) => `${side?.name ?? "(unknown)"}${side?.start === void 0 ? "" : `:${side.start}`}`;
5497
5506
  const clones = (outcome, metric) => outcome.kind === "figures" ? outcome.duplicates.map((entry) => ({
5498
5507
  metric,
5499
- path: entry.firstFile?.name ?? "(unknown)",
5500
- other: entry.secondFile?.name,
5501
- lines: entry.lines
5508
+ path: at(entry.firstFile),
5509
+ other: at(entry.secondFile),
5510
+ ...entry.lines === void 0 ? {} : { lines: entry.lines }
5502
5511
  })) : [];
5503
5512
  const deadMetric = {
5504
5513
  "unused-file": "unusedFiles",
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-SXIZBKVJ.js";
9
+ } from "./chunk-RH7TOWSN.js";
10
10
  import {
11
11
  BaseAdapter
12
12
  } from "./chunk-KLEXJFJ6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.5.0-alpha.11",
3
+ "version": "1.5.0-alpha.12",
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",