@dragonshorn-studios/elyseum-cli 1.0.8 → 1.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-coverage-command.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAMjD,qBAAa,mBAAoB,YAAW,OAAO;IACjD,IAAI,EAAE,MAAM,CAAmB;IAC/B,MAAM,CAAC,EAAE,YAAY,CA2BnB;gBACU,QAAQ,EAAE,UAAU;IAInB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAqI5B,qBAAqB;
|
|
1
|
+
{"version":3,"file":"diff-coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-coverage-command.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAMjD,qBAAa,mBAAoB,YAAW,OAAO;IACjD,IAAI,EAAE,MAAM,CAAmB;IAC/B,MAAM,CAAC,EAAE,YAAY,CA2BnB;gBACU,QAAQ,EAAE,UAAU;IAInB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAqI5B,qBAAqB;YA6KrB,iBAAiB;YAajB,eAAe;CA4E9B"}
|
package/dist/index.js
CHANGED
|
@@ -25088,13 +25088,25 @@ class GithubPRCommentCoverageReporter {
|
|
|
25088
25088
|
let annotations = [];
|
|
25089
25089
|
if (createAnnotations) {
|
|
25090
25090
|
for (const file of diffCoverage.files) {
|
|
25091
|
+
for (let lineBlock of file.lines.details || []) {
|
|
25092
|
+
if (lineBlock.hit === 0) {
|
|
25093
|
+
annotations.push({
|
|
25094
|
+
path: file.file,
|
|
25095
|
+
start_line: lineBlock.start,
|
|
25096
|
+
end_line: lineBlock.end,
|
|
25097
|
+
annotation_level: qualityGateFailed ? "failure" : "warning",
|
|
25098
|
+
title: "Lines not covered",
|
|
25099
|
+
message: `Lines not covered`,
|
|
25100
|
+
});
|
|
25101
|
+
}
|
|
25102
|
+
}
|
|
25091
25103
|
for (let functionDetails of file.functions.details || []) {
|
|
25092
25104
|
if (functionDetails.hit === 0) {
|
|
25093
25105
|
annotations.push({
|
|
25094
25106
|
path: file.file,
|
|
25095
25107
|
start_line: functionDetails.line,
|
|
25096
25108
|
end_line: functionDetails.line,
|
|
25097
|
-
annotation_level: qualityGateFailed ? "
|
|
25109
|
+
annotation_level: qualityGateFailed ? "failure" : "warning",
|
|
25098
25110
|
title: "Function not covered",
|
|
25099
25111
|
message: `Function ${functionDetails.name} not covered`,
|
|
25100
25112
|
});
|
|
@@ -25106,7 +25118,7 @@ class GithubPRCommentCoverageReporter {
|
|
|
25106
25118
|
path: file.file,
|
|
25107
25119
|
start_line: branchDetails.line,
|
|
25108
25120
|
end_line: branchDetails.line,
|
|
25109
|
-
annotation_level: qualityGateFailed ? "
|
|
25121
|
+
annotation_level: qualityGateFailed ? "failure" : "warning",
|
|
25110
25122
|
title: "Branch not covered",
|
|
25111
25123
|
message: `Branch not covered`,
|
|
25112
25124
|
});
|
|
@@ -25121,7 +25133,7 @@ class GithubPRCommentCoverageReporter {
|
|
|
25121
25133
|
head_sha: diffCoverage.headSha,
|
|
25122
25134
|
status: "completed",
|
|
25123
25135
|
conclusion: qualityGateFailed
|
|
25124
|
-
? "
|
|
25136
|
+
? "failure"
|
|
25125
25137
|
: qualityGateWarning
|
|
25126
25138
|
? "neutral"
|
|
25127
25139
|
: "success",
|
|
@@ -54446,8 +54458,25 @@ class DiffCoverageCommand {
|
|
|
54446
54458
|
let changedLineNumbers = new Set();
|
|
54447
54459
|
let changedLineCount = 0;
|
|
54448
54460
|
for (let hunk of file.diff.hunks) {
|
|
54461
|
+
let hunkLine = 0;
|
|
54449
54462
|
for (let line = hunk.newStart; line < hunk.newStart + hunk.newLines; line++) {
|
|
54463
|
+
if (hunk.lines) {
|
|
54464
|
+
if (hunk.lines[hunkLine].startsWith("-")) {
|
|
54465
|
+
continue;
|
|
54466
|
+
}
|
|
54467
|
+
else if (hunk.lines[hunkLine].startsWith("+")) {
|
|
54468
|
+
// ignore comment lines
|
|
54469
|
+
const changedLine = hunk.lines[hunkLine].replace(/^\+/, "");
|
|
54470
|
+
if (changedLine.trim().startsWith("//") ||
|
|
54471
|
+
changedLine.trim() === "" ||
|
|
54472
|
+
changedLine.trim().startsWith("/*") ||
|
|
54473
|
+
changedLine.trim().startsWith("*")) {
|
|
54474
|
+
continue;
|
|
54475
|
+
}
|
|
54476
|
+
}
|
|
54477
|
+
}
|
|
54450
54478
|
changedLineNumbers.add(line);
|
|
54479
|
+
hunkLine++;
|
|
54451
54480
|
}
|
|
54452
54481
|
changedLineCount += hunk.newLines;
|
|
54453
54482
|
}
|