@codacy/tools-revive-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 +7 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1045,13 +1045,14 @@ function generateReviveToml(patterns) {
|
|
|
1045
1045
|
for (const pattern of patterns) {
|
|
1046
1046
|
const ruleName = pattern.patternId.replace(`${TOOL_ID}_`, "");
|
|
1047
1047
|
lines.push(`[rule.${ruleName}]`);
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1048
|
+
const entries = Object.entries(pattern.parameters ?? {});
|
|
1049
|
+
if (entries.length > 0) {
|
|
1050
|
+
const args = entries.map(([, value]) => {
|
|
1051
|
+
const num = Number(value);
|
|
1052
|
+
if (!Number.isNaN(num) && String(value).trim() !== "") {
|
|
1052
1053
|
return String(num);
|
|
1053
1054
|
}
|
|
1054
|
-
return `"${String(
|
|
1055
|
+
return `"${String(value)}"`;
|
|
1055
1056
|
});
|
|
1056
1057
|
lines.push(` arguments = [${args.join(", ")}]`);
|
|
1057
1058
|
}
|
|
@@ -1061,6 +1062,7 @@ function generateReviveToml(patterns) {
|
|
|
1061
1062
|
}
|
|
1062
1063
|
var adapter = {
|
|
1063
1064
|
...descriptor,
|
|
1065
|
+
patternsMetadata: patterns_default,
|
|
1064
1066
|
compatibleVersions: ">=1.0.0",
|
|
1065
1067
|
website: "https://github.com/mgechev/revive",
|
|
1066
1068
|
prerequisites: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/tools-revive-1",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Revive adapter — CLI-mode Go linter",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@codacy/tooling": "0.
|
|
11
|
+
"@codacy/tooling": "0.8.0"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "Codacy <support@codacy.com> (https://www.codacy.com)",
|