@codacy/tools-scalastyle-1 0.3.4 → 0.4.1
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/dist/index.js +15 -39
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1061,24 +1061,6 @@ async function resolveJarPath(ctx) {
|
|
|
1061
1061
|
return null;
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
async function resolveJavaBinary(ctx) {
|
|
1065
|
-
const jreDir = import_path.default.join(ctx.globalDir, "runtimes", "java-17");
|
|
1066
|
-
const javaBin = import_path.default.join(jreDir, "bin", "java");
|
|
1067
|
-
try {
|
|
1068
|
-
await import_promises.default.access(javaBin);
|
|
1069
|
-
return javaBin;
|
|
1070
|
-
} catch {
|
|
1071
|
-
}
|
|
1072
|
-
if (process.env.JAVA_HOME) {
|
|
1073
|
-
const javaHome = import_path.default.join(process.env.JAVA_HOME, "bin", "java");
|
|
1074
|
-
try {
|
|
1075
|
-
await import_promises.default.access(javaHome);
|
|
1076
|
-
return javaHome;
|
|
1077
|
-
} catch {
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
return "java";
|
|
1081
|
-
}
|
|
1082
1064
|
function generateScalastyleConfig(patterns) {
|
|
1083
1065
|
const checks = [];
|
|
1084
1066
|
for (const pattern of patterns) {
|
|
@@ -1127,6 +1109,7 @@ var REQUIRES_USER_PARAMS = /* @__PURE__ */ new Set([
|
|
|
1127
1109
|
var CONFIG_FILE_CANDIDATES = ["scalastyle_config.xml", "scalastyle-config.xml"];
|
|
1128
1110
|
var adapter = {
|
|
1129
1111
|
...descriptor,
|
|
1112
|
+
patternsMetadata: patterns_default,
|
|
1130
1113
|
compatibleVersions: ">=1.0.0",
|
|
1131
1114
|
website: "http://www.scalastyle.org/",
|
|
1132
1115
|
prerequisites: [
|
|
@@ -1146,27 +1129,19 @@ var adapter = {
|
|
|
1146
1129
|
*/
|
|
1147
1130
|
async checkAvailability(ctx) {
|
|
1148
1131
|
ctx.logger.debug("Checking availability", { toolId: TOOL_ID });
|
|
1149
|
-
const javaInfo = await (0, import_tooling.
|
|
1150
|
-
|
|
1132
|
+
const { java: javaInfo, dependency: javaDep } = await (0, import_tooling.checkJavaRuntime)(
|
|
1133
|
+
ctx.globalDir,
|
|
1134
|
+
JAVA_VERSION_RANGE,
|
|
1135
|
+
ctx.logger
|
|
1136
|
+
);
|
|
1137
|
+
const dependencies = [javaDep];
|
|
1151
1138
|
if (!javaInfo) {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
dependencies
|
|
1157
|
-
|
|
1158
|
-
available: true,
|
|
1159
|
-
version: "17",
|
|
1160
|
-
installation: "codacy"
|
|
1161
|
-
};
|
|
1162
|
-
} catch {
|
|
1163
|
-
return {
|
|
1164
|
-
available: false,
|
|
1165
|
-
reason: "Java runtime not found (required for Scalastyle)",
|
|
1166
|
-
installHint: "Install JDK 8+, or run with --install-dependencies for auto-download",
|
|
1167
|
-
dependencies
|
|
1168
|
-
};
|
|
1169
|
-
}
|
|
1139
|
+
return {
|
|
1140
|
+
available: false,
|
|
1141
|
+
reason: "Java runtime not found (required for Scalastyle)",
|
|
1142
|
+
installHint: "Install JDK 8+, or run with --install-dependencies for auto-download",
|
|
1143
|
+
dependencies
|
|
1144
|
+
};
|
|
1170
1145
|
}
|
|
1171
1146
|
const jarPath = await resolveJarPath(ctx);
|
|
1172
1147
|
if (jarPath) {
|
|
@@ -1279,7 +1254,8 @@ var adapter = {
|
|
|
1279
1254
|
return (0, import_tooling.buildResult)(TOOL_ID, startedAt, /* @__PURE__ */ new Date(), issues, errors, 0);
|
|
1280
1255
|
}
|
|
1281
1256
|
const useLocal = codacyConfig.useLocalConfigurationFile && codacyConfig.localConfigurationFile;
|
|
1282
|
-
const
|
|
1257
|
+
const resolved = await (0, import_tooling.resolveJava)(ctx.globalDir, JAVA_VERSION_RANGE, ctx.logger);
|
|
1258
|
+
const javaBin = resolved?.path ?? "java";
|
|
1283
1259
|
const jarPath = await resolveJarPath(ctx);
|
|
1284
1260
|
if (!jarPath) {
|
|
1285
1261
|
errors.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/tools-scalastyle-1",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Scalastyle adapter — CLI-mode Scala style checker",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"fast-xml-parser": "^4.5.0",
|
|
12
|
-
"@codacy/tooling": "0.
|
|
12
|
+
"@codacy/tooling": "0.8.0"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "Codacy <support@codacy.com> (https://www.codacy.com)",
|