npm-groovy-lint 13.0.3-beta202312070716.0 → 13.0.3-beta202312161435.0

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.
@@ -130,45 +130,44 @@ class CodeNarcCaller {
130
130
  };
131
131
  }
132
132
 
133
- // Success result
134
- if (response.data && response.data.status === "success") {
133
+ if (response.data.status === "success") {
134
+ // Success result
135
135
  return {
136
- codeNarcJsonResult: await this.getCodeNarcJsonResult(response),
136
+ codeNarcJsonResult: response.data.jsonResult,
137
137
  fileList: response.data.fileList,
138
138
  parseErrors: response.data.parseErrors,
139
139
  codeNarcStdOut: response.data.stdout,
140
- codeNarcStdErr: response.data.stderr,
140
+ codeNarcStdErr: undefined,
141
141
  status: 0
142
142
  };
143
143
  }
144
- /*
145
- // Cancelled codeNarcAction (duplicate) (TODO: Update CodeNarcServer.groovy to cleanly stop task and not kill the thread !)
146
- else if (response.data && response.data.status === "cancelledByDuplicateRequest") {
144
+
145
+ if (response.data.status === "cancelledByDuplicateRequest") {
146
+ // Cancelled codeNarcAction (duplicate)
147
147
  return {
148
- codeNarcStdOut: response.data.stdout,
149
- codeNarcStdErr: response.data.stderr,
148
+ codeNarcStdOut: undefined,
149
+ codeNarcStdErr: undefined,
150
150
  status: 9
151
151
  };
152
- }*/
152
+ }
153
+
153
154
  // Codenarc error
154
- else {
155
- return {
156
- fileList: response.data.fileList,
157
- parseErrors: response.data.parseErrors,
158
- codeNarcJsonResult: await this.getCodeNarcJsonResult(response),
159
- codeNarcStdOut: response.data.stdout,
160
- codeNarcStdErr: response.data.stderr || response.data.errorDtl,
161
- status: 1,
162
- error: {
163
- msg: "CodeNarc error",
164
- msgDtl: {
165
- parseErrors: response.data.parseErrors,
166
- stdout: response.data.stdout,
167
- stderr: response.data.stderr || response.data.errorDtl
168
- }
155
+ return {
156
+ fileList: response.data.fileList,
157
+ parseErrors: response.data.parseErrors,
158
+ codeNarcJsonResult: response.data.jsonResult,
159
+ codeNarcStdOut: response.data.stdout,
160
+ codeNarcStdErr: response.data.errorDtl,
161
+ status: 1,
162
+ error: {
163
+ msg: `CodeNarc exception: ${response.data.exceptionType} message: ${response.data.errorMessage}`,
164
+ msgDtl: {
165
+ parseErrors: response.data.parseErrors,
166
+ stdout: response.data.stdout,
167
+ stderr: response.data.errorDtl
169
168
  }
170
- };
171
- }
169
+ }
170
+ };
172
171
  }
173
172
 
174
173
  // Call CodeNard java class
@@ -188,7 +188,7 @@ async function prepareCodeNarcCall(options) {
188
188
  * Converts a path with forward slashes to backslashes.
189
189
  *
190
190
  * @param {string} path The path to convert
191
- * @returns The converted path
191
+ * @return The converted path
192
192
  */
193
193
  function antPath(path) {
194
194
  return path.replace(/\\/gu, "/");
@@ -216,7 +216,7 @@ async function getCodeNarcBaseDirFromFiles(positionalArgs) {
216
216
  // Parse XML result file as js object
217
217
  async function parseCodeNarcResult(options, codeNarcBaseDir, codeNarcJsonResult, tmpGroovyFileName, parseErrors) {
218
218
  if (!codeNarcJsonResult || !codeNarcJsonResult.codeNarc || !codeNarcJsonResult.packages) {
219
- const errMsg = `Unable to use CodeNarc JSON result\n ${JSON.stringify(codeNarcJsonResult)}`;
219
+ const errMsg = `Unable to use CodeNarc JSON result\n${JSON.stringify(codeNarcJsonResult)}`;
220
220
  console.error(errMsg);
221
221
  return {
222
222
  status: 2,
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-groovy-lint",
3
- "version": "13.0.3-beta202312070716.0",
3
+ "version": "13.0.3-beta202312161435.0",
4
4
  "description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -59,12 +59,10 @@
59
59
  "fs-extra": "^8.1.0",
60
60
  "glob": "^7.1.6",
61
61
  "import-fresh": "^3.2.1",
62
- "ip": "^1.1.5",
63
62
  "java-caller": "^3.2.0",
64
63
  "js-yaml": "^4.1.0",
65
64
  "node-sarif-builder": "^2.0.3",
66
65
  "optionator": "^0.8.3",
67
- "semver": "^7.1.3",
68
66
  "strip-json-comments": "^3.0.1",
69
67
  "uuid": "^8.2.0"
70
68
  },