@kirill.konshin/lint 0.6.3 → 0.6.4
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/package.json
CHANGED
|
@@ -5508,6 +5508,7 @@ var auditReport_exports = /* @__PURE__ */ __exportAll({
|
|
|
5508
5508
|
coverageEntry: () => coverageEntry,
|
|
5509
5509
|
dedupe: () => dedupe,
|
|
5510
5510
|
exitCodeFor: () => exitCodeFor,
|
|
5511
|
+
findingsProblem: () => findingsProblem,
|
|
5511
5512
|
gitReader: () => gitReader,
|
|
5512
5513
|
grade: () => grade,
|
|
5513
5514
|
isGenerated: () => isGenerated,
|
|
@@ -5538,6 +5539,16 @@ function coverageEntry(value) {
|
|
|
5538
5539
|
};
|
|
5539
5540
|
}
|
|
5540
5541
|
/**
|
|
5542
|
+
* What makes a reader's findings unusable: a finding without one of the fields the report reads. The reader then
|
|
5543
|
+
* counts as not run, so the completion pass re-reads its part, rather than the report guessing at a field.
|
|
5544
|
+
*/
|
|
5545
|
+
function findingsProblem(findings) {
|
|
5546
|
+
for (const [index, finding] of findings.entries()) {
|
|
5547
|
+
const absent = FINDING_FIELDS.filter((field) => typeof finding?.[field] !== "string");
|
|
5548
|
+
if (absent.length) return `finding ${index + 1} lacks ${absent.map((field) => `\`${field}\``).join(", ")}`;
|
|
5549
|
+
}
|
|
5550
|
+
}
|
|
5551
|
+
/**
|
|
5541
5552
|
* Whether the quote is really at its line: the normalized quote appears in the normalized text of the
|
|
5542
5553
|
* lines starting at the cited line or one above and running one line past what the quote spans — so a
|
|
5543
5554
|
* fragment may run onto the next line and a worker copying from a numbered excerpt may be one line
|
|
@@ -5836,6 +5847,8 @@ function main$1(read = commitReader) {
|
|
|
5836
5847
|
problems.push(`\`${rel}\` needed a syntax repair (${error.message}); its content was kept as written.`);
|
|
5837
5848
|
}
|
|
5838
5849
|
if (!Array.isArray(parsed.findings) || typeof parsed.coverage !== "object") throw new Error("missing `findings` or `coverage`");
|
|
5850
|
+
const problem = findingsProblem(parsed.findings);
|
|
5851
|
+
if (problem) throw new Error(problem);
|
|
5839
5852
|
return {
|
|
5840
5853
|
...parsed,
|
|
5841
5854
|
part: n,
|
|
@@ -5879,7 +5892,7 @@ function cli(argv) {
|
|
|
5879
5892
|
process.stdout.write(line + "\n");
|
|
5880
5893
|
return argv.includes("--gate") ? exitCodeFor(line.split(" ")[0]) : 0;
|
|
5881
5894
|
}
|
|
5882
|
-
var MERGE_FILE, VERDICT_FILE, ERROR_CLASS, INFO_CLASS, CHECKS, normalize, isGenerated, gitReader, commitReader, worktreeReader, rank, tierRank, exitCodeFor, unitOf, firstSentence, findingLine;
|
|
5895
|
+
var MERGE_FILE, VERDICT_FILE, ERROR_CLASS, INFO_CLASS, CHECKS, FINDING_FIELDS, normalize, isGenerated, gitReader, commitReader, worktreeReader, rank, tierRank, exitCodeFor, unitOf, firstSentence, findingLine;
|
|
5883
5896
|
var init_auditReport = __esmMin((() => {
|
|
5884
5897
|
init_esm();
|
|
5885
5898
|
init_files();
|
|
@@ -5899,6 +5912,11 @@ var init_auditReport = __esmMin((() => {
|
|
|
5899
5912
|
"4": "A rule that no longer matches the implementation or architecture",
|
|
5900
5913
|
"5": "A rule whose tests satisfy the wording while failing to protect the intent"
|
|
5901
5914
|
};
|
|
5915
|
+
FINDING_FIELDS = [
|
|
5916
|
+
"kind",
|
|
5917
|
+
"where",
|
|
5918
|
+
"detail"
|
|
5919
|
+
];
|
|
5902
5920
|
normalize = (s) => s.replace(/\s+/g, " ").trim();
|
|
5903
5921
|
isGenerated = (file) => file.startsWith(`audit-parts/`) || /^(spec-verify|spec-review|spec-coverage|audit-scope)\.(md|json)$/.test(file);
|
|
5904
5922
|
gitReader = (ref, cwd = root()) => (file) => {
|