npm-groovy-lint 13.0.3-beta202312070716.0 → 14.0.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.
- package/README.md +1 -1
- package/lib/codenarc-caller.js +26 -27
- package/lib/codenarc-factory.js +2 -2
- package/lib/java/CodeNarcServer.jar +0 -0
- package/lib/java/jackson-annotations-2.16.0.jar +0 -0
- package/lib/java/jackson-core-2.16.0.jar +0 -0
- package/lib/java/jackson-databind-2.16.0.jar +0 -0
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -140,7 +140,7 @@ Any **question**, **problem** or **enhancement request** ? Ask [**here**](https:
|
|
|
140
140
|
|
|
141
141
|
- If you have issues with v9, install previous version with `npm install -g npm-groovy-lint@8.2.0`
|
|
142
142
|
- Node.js >= 12 is required to run this package. If you can't upgrade, you can use [nvm](https://github.com/nvm-sh/nvm) to have [different node versions on your computer](https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/)
|
|
143
|
-
- If you do not have java
|
|
143
|
+
- If you do not have java 17 installed on your computer, npm-groovy-lint will install them for you, so the first run may be long.
|
|
144
144
|
|
|
145
145
|
## Configuration
|
|
146
146
|
|
package/lib/codenarc-caller.js
CHANGED
|
@@ -130,45 +130,44 @@ class CodeNarcCaller {
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
if (response.data.status === "success") {
|
|
134
|
+
// Success result
|
|
135
135
|
return {
|
|
136
|
-
codeNarcJsonResult:
|
|
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:
|
|
140
|
+
codeNarcStdErr: undefined,
|
|
141
141
|
status: 0
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
|
|
145
|
+
if (response.data.status === "cancelledByDuplicateRequest") {
|
|
146
|
+
// Cancelled codeNarcAction (duplicate)
|
|
147
147
|
return {
|
|
148
|
-
codeNarcStdOut:
|
|
149
|
-
codeNarcStdErr:
|
|
148
|
+
codeNarcStdOut: undefined,
|
|
149
|
+
codeNarcStdErr: undefined,
|
|
150
150
|
status: 9
|
|
151
151
|
};
|
|
152
|
-
}
|
|
152
|
+
}
|
|
153
|
+
|
|
153
154
|
// Codenarc error
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
package/lib/codenarc-factory.js
CHANGED
|
@@ -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
|
-
* @
|
|
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
|
|
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
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-groovy-lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.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
|
},
|