npm-groovy-lint 10.0.2 → 10.0.3
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/CHANGELOG.md +5 -0
- package/lib/groovy-lint.js +19 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## UNRELEASED
|
|
4
4
|
|
|
5
|
+
## [10.0.3] 2022-08-15
|
|
6
|
+
|
|
7
|
+
- Do not output results summary in console logs when output is json or sarif
|
|
8
|
+
- Add test methods for SARIF called by CLI
|
|
9
|
+
|
|
5
10
|
## [10.0.2] 2022-08-15
|
|
6
11
|
|
|
7
12
|
- Fix error when absolute files sent as positional arguments on a linux system ([#232](https://github.com/nvuillam/npm-groovy-lint/issues/232))
|
package/lib/groovy-lint.js
CHANGED
|
@@ -459,12 +459,12 @@ class NpmGroovyLint {
|
|
|
459
459
|
this.options.failon && this.options.failon !== "none"
|
|
460
460
|
? this.options.failon
|
|
461
461
|
: this.options.failonerror
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
462
|
+
? "error"
|
|
463
|
+
: this.options.failonwarning
|
|
464
|
+
? "warning"
|
|
465
|
+
: this.options.failoninfo
|
|
466
|
+
? "info"
|
|
467
|
+
: "none";
|
|
468
468
|
if (failureLevel === "none") {
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
@@ -475,21 +475,27 @@ class NpmGroovyLint {
|
|
|
475
475
|
|
|
476
476
|
// Fail on error
|
|
477
477
|
if (failureLevel === "error" && errorNb > 0) {
|
|
478
|
-
|
|
478
|
+
if (!["json", "sarif"].includes(this.outputType)) {
|
|
479
|
+
console.error(`Failure: ${this.lintResult.summary.totalFoundErrorNumber} error(s) have been found`);
|
|
480
|
+
}
|
|
479
481
|
this.status = 1;
|
|
480
482
|
}
|
|
481
483
|
// Fail on warning
|
|
482
484
|
else if (failureLevel === "warning" && (errorNb > 0 || warningNb > 0)) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
485
|
+
if (!["json", "sarif"].includes(this.outputType)) {
|
|
486
|
+
console.error(
|
|
487
|
+
`Failure: ${this.lintResult.summary.totalFoundErrorNumber} error(s) have been found \n ${this.lintResult.summary.totalFoundWarningNumber} warning(s) have been found`
|
|
488
|
+
);
|
|
489
|
+
}
|
|
486
490
|
this.status = 1;
|
|
487
491
|
}
|
|
488
492
|
// Fail on info
|
|
489
493
|
else if (failureLevel === "info" && (errorNb > 0 || warningNb > 0 || infoNb > 0)) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
494
|
+
if (!["json", "sarif"].includes(this.outputType)) {
|
|
495
|
+
console.error(
|
|
496
|
+
`Failure: ${this.lintResult.summary.totalFoundErrorNumber} error(s) have been found \n ${this.lintResult.summary.totalFoundWarningNumber} warning(s) have been found \n ${this.lintResult.summary.totalFoundInfoNumber} info(s) have been found`
|
|
497
|
+
);
|
|
498
|
+
}
|
|
493
499
|
this.status = 1;
|
|
494
500
|
}
|
|
495
501
|
}
|