ccqa 1.58.1 → 1.58.2
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/ccqa.mjs +10 -17
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -8710,16 +8710,14 @@ function rulesReview(guides) {
|
|
|
8710
8710
|
""
|
|
8711
8711
|
])
|
|
8712
8712
|
],
|
|
8713
|
-
answerShape: "{ \"findings\": [ { \"stepId\": \"step-05\", \"problem\": \"…\" } ], \"ruleViolations\": [ { \"file\": \"…\", \"guide\": \"…\", \"rule\": \"…\", \"code\": \"…\"
|
|
8713
|
+
answerShape: "{ \"findings\": [ { \"stepId\": \"step-05\", \"problem\": \"…\" } ], \"ruleViolations\": [ { \"file\": \"…\", \"guide\": \"…\", \"rule\": \"…\", \"code\": \"…\" } ] }",
|
|
8714
8714
|
answerNote: [
|
|
8715
8715
|
"",
|
|
8716
8716
|
"In `ruleViolations`: `file` is the file's path in this repository, and `code`",
|
|
8717
8717
|
"the lines that break the rule. `guide` and `rule` are where the rule comes",
|
|
8718
8718
|
"from and what it says — the document's path and its own words when you can",
|
|
8719
8719
|
"quote one; otherwise the path of a file you read that shows the convention,",
|
|
8720
|
-
"and what you counted (\"N of M files under <dir> do X\").
|
|
8721
|
-
"\"blocking\" when you would hold the change until it is fixed, and \"advisory\"",
|
|
8722
|
-
"when it is worth saying but you would approve anyway. An empty",
|
|
8720
|
+
"and what you counted (\"N of M files under <dir> do X\"). An empty",
|
|
8723
8721
|
"`ruleViolations` means every file follows every rule you could quote or",
|
|
8724
8722
|
"count — write the key either way."
|
|
8725
8723
|
]
|
|
@@ -9150,8 +9148,7 @@ const ViolationSchema = z.object({
|
|
|
9150
9148
|
file: z.string(),
|
|
9151
9149
|
guide: z.string(),
|
|
9152
9150
|
rule: z.string(),
|
|
9153
|
-
code: z.string()
|
|
9154
|
-
severity: z.enum(["blocking", "advisory"]).catch("blocking")
|
|
9151
|
+
code: z.string()
|
|
9155
9152
|
});
|
|
9156
9153
|
const ViolationsSchema = z.object({ ruleViolations: z.array(z.unknown()) });
|
|
9157
9154
|
/**
|
|
@@ -9239,14 +9236,11 @@ function formatFinding(finding, labels = evidenceLabels()) {
|
|
|
9239
9236
|
}
|
|
9240
9237
|
/**
|
|
9241
9238
|
* The warning a rule violation becomes: the file, the rule in the words it was
|
|
9242
|
-
* judged by, and where that came from.
|
|
9243
|
-
*
|
|
9244
|
-
* offending code is left out: it is what the fix pass needs, not what a reader
|
|
9245
|
-
* scanning a log does.
|
|
9239
|
+
* judged by, and where that came from. The offending code is left out: it is
|
|
9240
|
+
* what the fix pass needs, not what a reader scanning a log does.
|
|
9246
9241
|
*/
|
|
9247
9242
|
function formatViolation(violation) {
|
|
9248
|
-
|
|
9249
|
-
return `${violation.file}: ${violation.rule} (${violation.guide}${advisory})`;
|
|
9243
|
+
return `${violation.file}: ${violation.rule} (${violation.guide})`;
|
|
9250
9244
|
}
|
|
9251
9245
|
/**
|
|
9252
9246
|
* Hand the written files to a reviewer who knows nothing about where they came
|
|
@@ -15179,13 +15173,12 @@ function uncheckedSteps(review, alreadyAsked = /* @__PURE__ */ new Set()) {
|
|
|
15179
15173
|
* arrived. Absent violations are absent either way — there is nothing here to
|
|
15180
15174
|
* act on when that half never came.
|
|
15181
15175
|
*
|
|
15182
|
-
*
|
|
15183
|
-
*
|
|
15184
|
-
*
|
|
15185
|
-
* the advisory ones too, marked as such.
|
|
15176
|
+
* Every violation the reviewer reports: a rule the project wrote down, or a
|
|
15177
|
+
* convention its files share, is the project's decision, not the reviewer's to
|
|
15178
|
+
* waive.
|
|
15186
15179
|
*/
|
|
15187
15180
|
function guideViolations(review, alreadyAsked = /* @__PURE__ */ new Set()) {
|
|
15188
|
-
const violations = (review?.ruleViolations ?? []).filter((v) =>
|
|
15181
|
+
const violations = (review?.ruleViolations ?? []).filter((v) => !alreadyAsked.has(violationKey(v)));
|
|
15189
15182
|
if (violations.length === 0) return null;
|
|
15190
15183
|
return {
|
|
15191
15184
|
exitCode: 1,
|
package/dist/package.json
CHANGED