@zohodesk/codestandard-validator 1.2.4-exp-6 → 1.2.4-exp-8
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/bin/cliCI.js +0 -19
- package/bin/zdcodequality.js +3 -2
- package/build/ai/ollama-service.js +3 -1
- package/build/hooks/hook.js +3 -1
- package/build/utils/General/Config.js +4 -0
- package/build/utils/PluginsInstallation/checkIfPluginsAreInstalled.js +1 -0
- package/index.js +0 -1
- package/package.json +2 -2
package/bin/cliCI.js
CHANGED
|
@@ -7,25 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
(async function () {
|
|
10
|
-
// var args = process.argv.slice(2);
|
|
11
|
-
// if (args.indexOf('mutate') !== -1) {
|
|
12
|
-
// var MutationCli = require('../build/mutation/mutationCli');
|
|
13
|
-
// var cli = new MutationCli();
|
|
14
|
-
// cli.execute(args).then(function (result) {
|
|
15
|
-
// if (!result.success) {
|
|
16
|
-
// console.error('Mutation testing failed:', result.error);
|
|
17
|
-
// process.exitCode = 1;
|
|
18
|
-
// } else {
|
|
19
|
-
// if (result.filePath) console.log('Mutation report written to:', result.filePath);
|
|
20
|
-
// if (result.message) console.log(result.message);
|
|
21
|
-
// }
|
|
22
|
-
// }).catch(function (err) {
|
|
23
|
-
// console.error('Mutation testing error:', err.message || err);
|
|
24
|
-
// process.exitCode = 1;
|
|
25
|
-
// });
|
|
26
|
-
// return;
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
10
|
const { initConfig, getConfigPathExecute, postInstallExecution } = require('../build/utils/General/Config');
|
|
30
11
|
await initConfig(getConfigPathExecute());
|
|
31
12
|
await postInstallExecution()
|
package/bin/zdcodequality.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
var args = process.argv.slice(2);
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
|
|
20
20
|
if (args.indexOf('mutate') === -1) {
|
|
21
21
|
console.error('Usage: npx zdcodequality mutate --local [--branch=<branch>]');
|
|
@@ -27,6 +27,8 @@ if (args.indexOf('mutate') === -1) {
|
|
|
27
27
|
|
|
28
28
|
var MutationCli = require('../build/mutation/mutationCli');
|
|
29
29
|
const { initConfig } = require('../build/utils/General/Config');
|
|
30
|
+
const { getConfigPathExecute } = require('../build/utils/General/Config');
|
|
31
|
+
initConfig(getConfigPathExecute());
|
|
30
32
|
var cli = new MutationCli({
|
|
31
33
|
token: process.env.ZGIT_TOKEN,
|
|
32
34
|
gitEndPoint: process.env.GIT_END_POINT,
|
|
@@ -34,7 +36,6 @@ var cli = new MutationCli({
|
|
|
34
36
|
compareBranch: process.env.COMPARE_BRANCH,
|
|
35
37
|
projectId: process.env.PROJECT_ID
|
|
36
38
|
});
|
|
37
|
-
console.log('cli:', cli);
|
|
38
39
|
cli.execute(args).then(function (result) {
|
|
39
40
|
if (!result.success) {
|
|
40
41
|
console.error('Mutation testing failed:', result.error);
|
|
@@ -21,10 +21,12 @@ function sanitizeStreamText(text) {
|
|
|
21
21
|
* Ollama API Configuration Schema
|
|
22
22
|
* Ref: https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion
|
|
23
23
|
*/
|
|
24
|
+
|
|
25
|
+
const LOCALHOST = ""; // FIll HOST HERE
|
|
24
26
|
const API_CONFIG_SCHEMA = {
|
|
25
27
|
baseUrl: {
|
|
26
28
|
type: 'string',
|
|
27
|
-
default:
|
|
29
|
+
default: LOCALHOST,
|
|
28
30
|
required: true
|
|
29
31
|
},
|
|
30
32
|
model: {
|
package/build/hooks/hook.js
CHANGED
|
@@ -26,7 +26,8 @@ const {
|
|
|
26
26
|
} = require('./Precommit/guard');
|
|
27
27
|
const {
|
|
28
28
|
initConfig,
|
|
29
|
-
getConfigPathExecute
|
|
29
|
+
getConfigPathExecute,
|
|
30
|
+
postInstallExecution
|
|
30
31
|
} = require('../utils/General/Config');
|
|
31
32
|
async function hooks() {
|
|
32
33
|
var jsonFilePath = path.join(__dirname, '..', '..', 'jsonUtils', 'fsUtils.json');
|
|
@@ -54,6 +55,7 @@ async function hooks() {
|
|
|
54
55
|
}
|
|
55
56
|
(async function () {
|
|
56
57
|
await initConfig(getConfigPathExecute());
|
|
58
|
+
postInstallExecution();
|
|
57
59
|
await require("../chunk/chunk_Restriction");
|
|
58
60
|
hooks();
|
|
59
61
|
})();
|
|
@@ -10,6 +10,10 @@ function initConfig(actualConfigPath) {
|
|
|
10
10
|
process.env.SONARQUBE = config.meticHandler_api_token;
|
|
11
11
|
process.env.ZGIT_TOKEN = config.token;
|
|
12
12
|
process.env.TOOL_TOKEN = config.toolToken;
|
|
13
|
+
process.env.PROJECT_ID = config.projectId;
|
|
14
|
+
process.env.GIT_END_POINT = config.gitEndPoint;
|
|
15
|
+
process.env.BRANCH_DIFF_PATH = config.branchDiffPath;
|
|
16
|
+
process.env.COMPARE_BRANCH = config.compareBranch;
|
|
13
17
|
}
|
|
14
18
|
function postInstallExecution() {
|
|
15
19
|
const {
|
|
@@ -34,6 +34,7 @@ function getAllPlugins() {
|
|
|
34
34
|
}
|
|
35
35
|
if (!Array.isArray(commonPlugins) || !Array.isArray(serviceSpecificPlugins)) {
|
|
36
36
|
Logger.log(Logger.FAILURE_TYPE, 'Plugin details should be in an array format in pluginVersion.js file');
|
|
37
|
+
return Object.assign([], commonPlugins.getEntries(), serviceSpecificPlugins.getEntries());
|
|
37
38
|
}
|
|
38
39
|
return Object.assign([], commonPlugins, serviceSpecificPlugins);
|
|
39
40
|
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const { getLintConfigurationUtil } = require("./build/utils/ConfigFileUtils/getLintConfiguration");
|
|
2
2
|
const { rulesConfig, plugins, extendPlugins } = getLintConfigurationUtil();
|
|
3
|
-
// const Mutant = require("./build/mutation/index");
|
|
4
3
|
|
|
5
4
|
module.exports = {
|
|
6
5
|
rulesConfig,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/codestandard-validator",
|
|
3
|
-
"version": "1.2.4-exp-
|
|
3
|
+
"version": "1.2.4-exp-8",
|
|
4
4
|
"description": "library to enforce code standard using eslint",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
|
-
|
|
8
|
+
"postinstall": "node bin/postinstall.js",
|
|
9
9
|
"build": "babel -d ./build ./src --copy-files"
|
|
10
10
|
},
|
|
11
11
|
"author": "",
|