@codacy/tools-scalastyle-1 0.4.16 → 0.5.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 +5 -2
- package/dist/index.js +10 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -63,13 +63,16 @@ To install the Scalastyle JAR locally for integration testing:
|
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
mkdir -p /tmp/codacy-scalastyle-test-tools
|
|
66
|
-
curl -L -
|
|
66
|
+
curl -L -O --output-dir /tmp/codacy-scalastyle-test-tools \
|
|
67
67
|
https://repo1.maven.org/maven2/com/beautiful-scala/scalastyle_2.13/1.5.1/scalastyle_2.13-1.5.1-assembly.jar
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
The filename must be kept as published (`scalastyle_2.13-<version>-assembly.jar`) — the adapter's
|
|
71
|
+
presence check is version-stamped, so a renamed JAR will not be found.
|
|
72
|
+
|
|
70
73
|
## Notes for maintainers
|
|
71
74
|
|
|
72
|
-
- Scalastyle requires Java 8+ as a runtime. The adapter uses `ensureJre()` to download Adoptium Temurin JDK
|
|
75
|
+
- Scalastyle requires Java 8+ as a runtime. The adapter uses `ensureJre()` to download Adoptium Temurin JDK 21 if no system Java is found.
|
|
73
76
|
- The assembly JAR (~9 MB) is downloaded from Maven Central via `downloadJar()` to `~/.codacy/tools/scalastyle-1/`.
|
|
74
77
|
- Scalastyle takes **directories** as input, not individual file lists. The adapter passes the repository root and then filters the XML output by `ctx.targetFiles`.
|
|
75
78
|
- XML output is written to a temp file via `--xmlOutput`, not to stdout. The adapter reads and parses the temp file after execution.
|
package/dist/index.js
CHANGED
|
@@ -1008,8 +1008,9 @@ var descriptor = {
|
|
|
1008
1008
|
// src/adapter.ts
|
|
1009
1009
|
var TOOL_ID = "ScalaStyle";
|
|
1010
1010
|
var SCALASTYLE_VERSION = "1.5.1";
|
|
1011
|
-
var
|
|
1012
|
-
var
|
|
1011
|
+
var SCALA_BINARY_VERSION = "2.13";
|
|
1012
|
+
var JAR_NAME = `scalastyle_${SCALA_BINARY_VERSION}-${SCALASTYLE_VERSION}-assembly.jar`;
|
|
1013
|
+
var JAR_URL = `https://repo1.maven.org/maven2/com/beautiful-scala/scalastyle_${SCALA_BINARY_VERSION}/${SCALASTYLE_VERSION}/${JAR_NAME}`;
|
|
1013
1014
|
var JAVA_VERSION_RANGE = ">=8";
|
|
1014
1015
|
var FILE_LEVEL_CHECKERS = /* @__PURE__ */ new Set([
|
|
1015
1016
|
"FileLengthChecker",
|
|
@@ -1116,7 +1117,7 @@ var adapter = {
|
|
|
1116
1117
|
{
|
|
1117
1118
|
name: "Java",
|
|
1118
1119
|
versionRange: JAVA_VERSION_RANGE,
|
|
1119
|
-
preferredVersion: "
|
|
1120
|
+
preferredVersion: "21",
|
|
1120
1121
|
checkCommand: "java -version"
|
|
1121
1122
|
}
|
|
1122
1123
|
],
|
|
@@ -1188,6 +1189,12 @@ var adapter = {
|
|
|
1188
1189
|
ctx.logger.info(`Downloading Scalastyle ${SCALASTYLE_VERSION} JAR...`);
|
|
1189
1190
|
const jarPath = await (0, import_tooling.downloadJar)(JAR_URL, ctx.toolInstallDir, JAR_NAME, ctx.logger);
|
|
1190
1191
|
ctx.logger.info(`Downloaded Scalastyle to ${jarPath}`);
|
|
1192
|
+
await (0, import_tooling.pruneSupersededArtifacts)(
|
|
1193
|
+
ctx.toolInstallDir,
|
|
1194
|
+
JAR_NAME,
|
|
1195
|
+
(name) => name === "scalastyle.jar" || /^scalastyle_.*-assembly\.jar$/.test(name),
|
|
1196
|
+
ctx.logger
|
|
1197
|
+
);
|
|
1191
1198
|
return { success: true, installedPath: jarPath, installedVersion: SCALASTYLE_VERSION };
|
|
1192
1199
|
} catch (err) {
|
|
1193
1200
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/tools-scalastyle-1",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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.22.0"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "Codacy <support@codacy.com> (https://www.codacy.com)",
|