@hublo/sentinel 1.7.0-alpha.32 → 1.7.0-alpha.33

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.
@@ -13,7 +13,7 @@ import {
13
13
  presetNotInstalledYet,
14
14
  registerAdapters,
15
15
  resolve
16
- } from "../chunk-UJ5VLEZF.js";
16
+ } from "../chunk-Y7UTRV4W.js";
17
17
  import "../chunk-ZZMYV576.js";
18
18
  import {
19
19
  resolveContext,
@@ -13464,7 +13464,7 @@ function renderMarkdown5(report) {
13464
13464
  ...templatesLine(report),
13465
13465
  ...fileBlocks(report),
13466
13466
  "",
13467
- `<sub>${levelsLine(report)}Every place, with the SQL behind it and sentinel's notes, is in the \`sql.html\` this run keeps. Measured by sentinel ${report.sentinel}.</sub>`,
13467
+ `<sub>Every place, with the SQL behind it and sentinel's notes, is in the \`sql.html\` this run keeps. Measured by sentinel ${report.sentinel}.</sub>`,
13468
13468
  ""
13469
13469
  ].join("\n");
13470
13470
  }
@@ -13479,8 +13479,8 @@ function headline3(report) {
13479
13479
  }
13480
13480
  const counts2 = (count, what, noun) => `**${count}** ${what} ${noun}${count === 1 ? "" : "s"}`;
13481
13481
  const calls = [
13482
- ...report.rulesOff.includes(UNSAFE_RULE) ? [] : [counts2(report.unsafe.calls, "raw SQL", "call")],
13483
- ...report.rulesOff.includes(RAW_FRAGMENT_RULE) ? [] : [counts2(report.unsafe.rawCalls, "Prisma", "fragment")]
13482
+ ...report.rulesOff.includes(UNSAFE_RULE) || report.unsafe.calls === 0 ? [] : [counts2(report.unsafe.calls, "raw SQL", "call")],
13483
+ ...report.rulesOff.includes(RAW_FRAGMENT_RULE) || report.unsafe.rawCalls === 0 ? [] : [counts2(report.unsafe.rawCalls, "Prisma", "fragment")]
13484
13484
  ];
13485
13485
  const items = [
13486
13486
  ...migrations > 0 ? [`**${migrations}** migration${migrations === 1 ? "" : "s"}`] : [],
@@ -13535,8 +13535,9 @@ function byFile2(findings) {
13535
13535
  const errors = (list) => list.filter((finding3) => finding3.level === "error").length;
13536
13536
  return [...groups].map(([file, list]) => [
13537
13537
  file,
13538
+ // By line; on one line, a finding at `error` first, since it is what the module refuses.
13538
13539
  [...list].sort(
13539
- (a, b) => a.line - b.line || a.column - b.column || a.rule.localeCompare(b.rule)
13540
+ (a, b) => a.line - b.line || Number(b.level === "error") - Number(a.level === "error") || a.column - b.column || a.rule.localeCompare(b.rule)
13540
13541
  )
13541
13542
  ]).sort(
13542
13543
  ([fileA, a], [fileB, b]) => errors(b) - errors(a) || b.length - a.length || fileA.localeCompare(fileB)
@@ -13567,9 +13568,6 @@ function endOf(text) {
13567
13568
  function cell3(text) {
13568
13569
  return text.replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ");
13569
13570
  }
13570
- function levelsLine(report) {
13571
- return errorFindings(report.findings).length === 0 ? "" : "A rule the module sets to `error` fails the module's `sql` run; every other finding is a warning. ";
13572
- }
13573
13571
  function offBlock(report) {
13574
13572
  if (report.read.length === 0 && report.unsafe.files.length === 0 || report.rulesOff.length === 0)
13575
13573
  return [];
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-UJ5VLEZF.js";
9
+ } from "./chunk-Y7UTRV4W.js";
10
10
  import "./chunk-ZZMYV576.js";
11
11
  import {
12
12
  BaseAdapter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.7.0-alpha.32",
3
+ "version": "1.7.0-alpha.33",
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",