@hublo/sentinel 1.5.0-alpha.32 → 1.5.0-alpha.34
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
|
@@ -4824,7 +4824,17 @@ function findBuildOutput(cwd) {
|
|
|
4824
4824
|
const builds = typeof pkg.scripts?.["build"] === "string" || pkg.nx?.targets?.["build"] !== void 0;
|
|
4825
4825
|
const declaresOutputs = Array.isArray(pkg.nx?.targets?.["build"]?.["outputs"]);
|
|
4826
4826
|
return {
|
|
4827
|
-
reason: builds ?
|
|
4827
|
+
reason: builds ? (declaresOutputs ? "nothing is built here, so build this module before measuring" : "the build wrote no files here, so declare `outputs` on its nx build target as `apps/front/career` does") + /*
|
|
4828
|
+
* ⛔ Problem, then solution, in ONE sentence and under 120 characters. The sentence that
|
|
4829
|
+
* stood here ran 230 characters of nested clauses and a reader said what was wrong with
|
|
4830
|
+
* it: *"un developpeur a bcp de taches en parallele donc son cerveau est concis, precis,
|
|
4831
|
+
* probleme / solution tout court"*. One sentence because the recap prints only the first:
|
|
4832
|
+
* split in two, the comment would carry the problem and lose the fix.
|
|
4833
|
+
*
|
|
4834
|
+
* ⚠️ The mechanism belongs AFTER, where the page and the json carry it and the comment
|
|
4835
|
+
* does not. It is the explanation, and nobody acts on an explanation.
|
|
4836
|
+
*/
|
|
4837
|
+
". A build target with no declared `outputs` is still cached, and on a cache hit nx reports the task successful, restores no file and leaves the directory empty, so every job that reads the build sees nothing. Measured on this monorepo: 5 of the 48 projects with a build target are in that state, so the six bundle figures cannot be produced for any of them until they declare where their build writes." : "this module declares no build, so there is nothing to measure here. A component library and a back-end service are in that case by construction, and no action follows.",
|
|
4828
4838
|
lookedIn
|
|
4829
4839
|
};
|
|
4830
4840
|
}
|
|
@@ -6084,15 +6094,22 @@ function renderMarkdown(report) {
|
|
|
6084
6094
|
...notes,
|
|
6085
6095
|
"",
|
|
6086
6096
|
...families,
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6097
|
+
/*
|
|
6098
|
+
* ⛔ ONE line, and it used to be five.
|
|
6099
|
+
*
|
|
6100
|
+
* The reserve explained `ok`, `near` and `exceeds`, defended the absence of a verdict as "a
|
|
6101
|
+
* decision and not a gap", and restated a counting rule. Measured on a five-module pull
|
|
6102
|
+
* request: not one of the 150 figures carried a verdict, so most of it explained a notation
|
|
6103
|
+
* that appeared nowhere and argued with an objection the reader had not made. A reader's
|
|
6104
|
+
* verdict on it: *"on doit supprimer, laissons le message efficace le plus possible"*.
|
|
6105
|
+
*
|
|
6106
|
+
* ⚠️ What survives is the one clause that prevents a WRONG READING rather than defending a
|
|
6107
|
+
* choice: a figure in a pull-request comment is read as a delta by default, so a module
|
|
6108
|
+
* already at 6.81% would look like one this branch pushed there. Plus where the detail is,
|
|
6109
|
+
* and the version, because two recaps from two versions are not comparable and nothing else
|
|
6110
|
+
* on the comment would say so.
|
|
6111
|
+
*/
|
|
6112
|
+
`<sub>Values on this branch, not a diff with \`main\`. Nothing here blocks the merge. The code behind every place, and the import graph, are in the \`static-analysis.html\` this run keeps as an artifact.${version === void 0 ? "" : ` Measured by sentinel ${version}.`}</sub>`,
|
|
6096
6113
|
""
|
|
6097
6114
|
].join("\n");
|
|
6098
6115
|
}
|
|
@@ -6285,10 +6302,11 @@ function summaryParts(report, bold) {
|
|
|
6285
6302
|
const findings = report.findings ?? [];
|
|
6286
6303
|
const inTests = findings.filter((finding) => finding.metric === "clonesTests").length;
|
|
6287
6304
|
const inProduct = findings.length - inTests;
|
|
6305
|
+
const thresholds = withReference.length === 0 ? [] : above === 0 ? [`${bold("No threshold exceeded")}: the measured levels are within the recommended norm`] : [`${bold(`${above} threshold${above === 1 ? "" : "s"} exceeded`)}`];
|
|
6288
6306
|
return [
|
|
6289
|
-
|
|
6290
|
-
`${bold(grouped(inProduct))}
|
|
6291
|
-
...inTests === 0 ? [] : [`${bold(grouped(inTests))}
|
|
6307
|
+
...thresholds,
|
|
6308
|
+
`${bold(grouped(inProduct))} place${inProduct === 1 ? "" : "s"} in product code`,
|
|
6309
|
+
...inTests === 0 ? [] : [`${bold(grouped(inTests))} clone${inTests === 1 ? "" : "s"} in tests`]
|
|
6292
6310
|
];
|
|
6293
6311
|
}
|
|
6294
6312
|
function summaryLine(report) {
|
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.34",
|
|
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",
|