@hublo/sentinel 1.5.0-alpha.8 → 1.5.0-alpha.9

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-DKLQYGPI.js";
18
+ } from "../chunk-OZZICSSZ.js";
19
19
  import {
20
20
  resolveContext
21
21
  } from "../chunk-KLEXJFJ6.js";
@@ -4820,11 +4820,14 @@ function helpFor(key) {
4820
4820
  }
4821
4821
 
4822
4822
  // src/roles/static-analysis/report.ts
4823
+ function shown(row) {
4824
+ return row.unit === "%" && typeof row.value === "number" ? row.value.toFixed(2) : String(row.value);
4825
+ }
4823
4826
  function renderConsole(report) {
4824
4827
  const lines = [];
4825
4828
  const width = (pick) => Math.max(...report.rows.map((row) => pick(row).length));
4826
4829
  const label = (row) => helpFor(row.metric)?.label ?? row.metric;
4827
- const value = (row) => `${row.value} ${row.unit}`;
4830
+ const value = (row) => `${shown(row)} ${row.unit}`;
4828
4831
  const labelWidth = width(label);
4829
4832
  const valueWidth = width(value);
4830
4833
  lines.push(`sentinel static-analysis: ${report.module}`);
@@ -4881,7 +4884,7 @@ function renderHtml(report) {
4881
4884
  const help = helpFor(row.metric);
4882
4885
  return ` <tr>
4883
4886
  <th scope="row">${escape(help?.label ?? row.metric)}</th>
4884
- <td class="num">${escape(String(row.value))} <span class="unit">${escape(row.unit)}</span></td>
4887
+ <td class="num">${escape(shown(row))} <span class="unit">${escape(row.unit)}</span></td>
4885
4888
  <td class="caveat">${escape(help?.caveat ?? "")}</td>
4886
4889
  </tr>`;
4887
4890
  }).join("\n");
@@ -5947,11 +5950,11 @@ var TscAdapter = class _TscAdapter extends BaseAdapter {
5947
5950
  * errors in the output mean the rule must be on.
5948
5951
  */
5949
5952
  noImplicitAnyEnabled(cwd, tsc, config, mainOutput) {
5950
- const shown = spawnSync6(tsc, ["-p", config, "--showConfig"], { cwd, encoding: "utf8" });
5951
- if (shown.status === 0 && shown.stdout) {
5953
+ const shown2 = spawnSync6(tsc, ["-p", config, "--showConfig"], { cwd, encoding: "utf8" });
5954
+ if (shown2.status === 0 && shown2.stdout) {
5952
5955
  try {
5953
5956
  const co = parseJsonc(
5954
- shown.stdout,
5957
+ shown2.stdout,
5955
5958
  "tsconfig(--showConfig)"
5956
5959
  ).compilerOptions;
5957
5960
  if (co) return co.noImplicitAny ?? co.strict === true;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-DKLQYGPI.js";
9
+ } from "./chunk-OZZICSSZ.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.8",
3
+ "version": "1.5.0-alpha.9",
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",