@abaplint/cli 2.102.56 → 2.102.57

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.
Files changed (2) hide show
  1. package/build/cli.js +114 -1
  2. package/package.json +6 -6
package/build/cli.js CHANGED
@@ -295,6 +295,10 @@ class Formatter {
295
295
  return new Formatters.CodeFrame().output(issues, fileCount);
296
296
  case "checkstyle":
297
297
  return new Formatters.Checkstyle().output(issues, fileCount);
298
+ case "sonarqube":
299
+ return new Formatters.Sonarqube().output(issues, fileCount);
300
+ case "codeclimate":
301
+ return new Formatters.CodeClimate().output(issues, fileCount);
298
302
  default:
299
303
  return new Formatters.Standard().output(issues, fileCount);
300
304
  }
@@ -359,6 +363,51 @@ exports.Checkstyle = Checkstyle;
359
363
 
360
364
  /***/ }),
361
365
 
366
+ /***/ "./build/src/formatters/codeclimate.js":
367
+ /*!*********************************************!*\
368
+ !*** ./build/src/formatters/codeclimate.js ***!
369
+ \*********************************************/
370
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
371
+
372
+ "use strict";
373
+
374
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
375
+ exports.CodeClimate = void 0;
376
+ const node_crypto_1 = __webpack_require__(/*! node:crypto */ "node:crypto");
377
+ function md5(content) {
378
+ return (0, node_crypto_1.createHash)("md5").update(content).digest("hex");
379
+ }
380
+ class CodeClimate {
381
+ output(issues, _fileCount) {
382
+ const out = [];
383
+ const defaultSeverity = "info";
384
+ const severityArray = ["info", "minor", "major", "critical", "blocker"];
385
+ for (const issue of issues) {
386
+ const single = {
387
+ type: "issue",
388
+ check_name: issue.getKey(),
389
+ description: issue.getMessage(),
390
+ categories: ["Code Quality"],
391
+ location: {
392
+ path: issue.getFilename(),
393
+ lines: {
394
+ begin: issue.getStart().getRow(),
395
+ end: issue.getEnd().getRow(),
396
+ },
397
+ },
398
+ severity: (severityArray.includes(issue.getSeverity().toLowerCase())) ? issue.getSeverity().toLowerCase() : defaultSeverity,
399
+ fingerprint: md5(issue.getKey() + issue.getMessage() + issue.getFilename() + issue.getStart().getRow() + issue.getEnd().getRow()),
400
+ };
401
+ out.push(single);
402
+ }
403
+ return JSON.stringify(out) + "\n";
404
+ }
405
+ }
406
+ exports.CodeClimate = CodeClimate;
407
+ //# sourceMappingURL=codeclimate.js.map
408
+
409
+ /***/ }),
410
+
362
411
  /***/ "./build/src/formatters/codeframe.js":
363
412
  /*!*******************************************!*\
364
413
  !*** ./build/src/formatters/codeframe.js ***!
@@ -472,6 +521,8 @@ __exportStar(__webpack_require__(/*! ./standard */ "./build/src/formatters/stand
472
521
  __exportStar(__webpack_require__(/*! ./total */ "./build/src/formatters/total.js"), exports);
473
522
  __exportStar(__webpack_require__(/*! ./codeframe */ "./build/src/formatters/codeframe.js"), exports);
474
523
  __exportStar(__webpack_require__(/*! ./checkstyle */ "./build/src/formatters/checkstyle.js"), exports);
524
+ __exportStar(__webpack_require__(/*! ./sonarqube */ "./build/src/formatters/sonarqube.js"), exports);
525
+ __exportStar(__webpack_require__(/*! ./codeclimate */ "./build/src/formatters/codeclimate.js"), exports);
475
526
  //# sourceMappingURL=index.js.map
476
527
 
477
528
  /***/ }),
@@ -615,6 +666,57 @@ exports.Junit = Junit;
615
666
 
616
667
  /***/ }),
617
668
 
669
+ /***/ "./build/src/formatters/sonarqube.js":
670
+ /*!*******************************************!*\
671
+ !*** ./build/src/formatters/sonarqube.js ***!
672
+ \*******************************************/
673
+ /***/ ((__unused_webpack_module, exports) => {
674
+
675
+ "use strict";
676
+
677
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
678
+ exports.Sonarqube = void 0;
679
+ class Sonarqube {
680
+ output(issues, _fileCount) {
681
+ const out = {};
682
+ const issueArray = [];
683
+ const defaultSeverity = "INFO";
684
+ const severityArray = ["INFO", "MINOR", "MAJOR", "CRITICAL", "BLOCKER"];
685
+ for (const issue of issues) {
686
+ const startOffset = issue.getStart().getCol() - 1;
687
+ const endOffset = issue.getEnd().getCol() - 2;
688
+ const single = {
689
+ engineId: "abaplint",
690
+ ruleId: issue.getKey(),
691
+ severity: (severityArray.includes(issue.getSeverity().toUpperCase())) ? issue.getSeverity().toUpperCase() : defaultSeverity,
692
+ type: "CODE_SMELL",
693
+ primaryLocation: {
694
+ message: issue.getMessage(),
695
+ filePath: issue.getFilename(),
696
+ textRange: {
697
+ startLine: issue.getStart().getRow(),
698
+ endLine: issue.getEnd().getRow(),
699
+ startColumn: startOffset,
700
+ endColumn: endOffset,
701
+ },
702
+ },
703
+ effortMinutes: 10,
704
+ };
705
+ if (startOffset >= endOffset) {
706
+ delete single.primaryLocation.textRange.startColumn;
707
+ delete single.primaryLocation.textRange.endColumn;
708
+ }
709
+ issueArray.push(single);
710
+ }
711
+ out.issues = issueArray;
712
+ return JSON.stringify(out) + "\n";
713
+ }
714
+ }
715
+ exports.Sonarqube = Sonarqube;
716
+ //# sourceMappingURL=sonarqube.js.map
717
+
718
+ /***/ }),
719
+
618
720
  /***/ "./build/src/formatters/standard.js":
619
721
  /*!******************************************!*\
620
722
  !*** ./build/src/formatters/standard.js ***!
@@ -49204,7 +49306,7 @@ class Registry {
49204
49306
  }
49205
49307
  static abaplintVersion() {
49206
49308
  // magic, see build script "version.sh"
49207
- return "2.102.56";
49309
+ return "2.102.57";
49208
49310
  }
49209
49311
  getDDICReferences() {
49210
49312
  return this.ddicReferences;
@@ -81815,6 +81917,17 @@ module.exports = require("fs");
81815
81917
 
81816
81918
  /***/ }),
81817
81919
 
81920
+ /***/ "node:crypto":
81921
+ /*!******************************!*\
81922
+ !*** external "node:crypto" ***!
81923
+ \******************************/
81924
+ /***/ ((module) => {
81925
+
81926
+ "use strict";
81927
+ module.exports = require("node:crypto");
81928
+
81929
+ /***/ }),
81930
+
81818
81931
  /***/ "node:os":
81819
81932
  /*!**************************!*\
81820
81933
  !*** external "node:os" ***!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.56",
3
+ "version": "2.102.57",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,19 +38,19 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.56",
42
- "@types/chai": "^4.3.6",
41
+ "@abaplint/core": "^2.102.57",
42
+ "@types/chai": "^4.3.7",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.3",
45
45
  "@types/mocha": "^10.0.2",
46
- "@types/node": "^20.8.2",
46
+ "@types/node": "^20.8.4",
47
47
  "@types/progress": "^2.0.5",
48
48
  "chai": "^4.3.10",
49
49
  "chalk": "^5.3.0",
50
- "eslint": "^8.50.0",
50
+ "eslint": "^8.51.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
- "memfs": "^4.5.0",
53
+ "memfs": "^4.6.0",
54
54
  "minimist": "^1.2.8",
55
55
  "mocha": "^10.2.0",
56
56
  "progress": "^2.0.3",