opencode-sonarqube 2.0.0 → 2.0.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 +8 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4234,7 +4234,8 @@ async function deriveProjectKey(directory) {
|
|
|
4234
4234
|
return `project-${Date.now()}`;
|
|
4235
4235
|
}
|
|
4236
4236
|
function sanitizeProjectKey(input) {
|
|
4237
|
-
|
|
4237
|
+
const sanitized = input.toLowerCase().replaceAll(/[^a-z0-9-_]/g, "-").replaceAll(/-+/g, "-").replaceAll(/(?:^-)|(?:-$)/g, "").slice(0, 400);
|
|
4238
|
+
return sanitized || "project";
|
|
4238
4239
|
}
|
|
4239
4240
|
var configLogger, DEFAULT_CONFIG;
|
|
4240
4241
|
var init_config = __esm(() => {
|
|
@@ -4244,8 +4245,7 @@ var init_config = __esm(() => {
|
|
|
4244
4245
|
DEFAULT_CONFIG = {
|
|
4245
4246
|
level: "enterprise",
|
|
4246
4247
|
autoAnalyze: true,
|
|
4247
|
-
newCodeDefinition: "previous_version"
|
|
4248
|
-
sources: "src"
|
|
4248
|
+
newCodeDefinition: "previous_version"
|
|
4249
4249
|
};
|
|
4250
4250
|
});
|
|
4251
4251
|
|
|
@@ -19419,7 +19419,7 @@ function extractTaskId(output) {
|
|
|
19419
19419
|
return altMatch?.[1];
|
|
19420
19420
|
}
|
|
19421
19421
|
function sanitizeArgValue(value) {
|
|
19422
|
-
return value.replaceAll(/[
|
|
19422
|
+
return value.replaceAll(/[\n\r]/g, "");
|
|
19423
19423
|
}
|
|
19424
19424
|
async function runScanner(config3, state, options, directory) {
|
|
19425
19425
|
const dir = directory ?? process.cwd();
|
|
@@ -19459,7 +19459,7 @@ async function runScanner(config3, state, options, directory) {
|
|
|
19459
19459
|
stderr: "pipe",
|
|
19460
19460
|
env: {
|
|
19461
19461
|
...process.env,
|
|
19462
|
-
NODE_OPTIONS: "--max-old-space-size=4096
|
|
19462
|
+
NODE_OPTIONS: `${process.env["NODE_OPTIONS"] ?? ""} --max-old-space-size=4096`.trim()
|
|
19463
19463
|
}
|
|
19464
19464
|
});
|
|
19465
19465
|
const stdout = await new Response(proc.stdout).text();
|
|
@@ -20498,18 +20498,15 @@ async function executeSonarQubeTool(args, context) {
|
|
|
20498
20498
|
const config3 = loadConfig(context.config);
|
|
20499
20499
|
if (!config3) {
|
|
20500
20500
|
return formatError2(ErrorMessages.configurationMissing("SonarQube configuration not found.", [
|
|
20501
|
-
"Set environment variables: SONAR_HOST_URL and
|
|
20501
|
+
"Set environment variables: SONAR_HOST_URL, SONAR_USER, and SONAR_PASSWORD",
|
|
20502
20502
|
"Or create a .sonarqube/config.json file in your project",
|
|
20503
20503
|
"Or add plugin configuration in opencode.json"
|
|
20504
20504
|
]) + `
|
|
20505
20505
|
|
|
20506
20506
|
Required environment variables:
|
|
20507
20507
|
- SONAR_HOST_URL (e.g., https://sonarqube.company.com)
|
|
20508
|
-
-
|
|
20509
|
-
|
|
20510
|
-
Optional:
|
|
20511
|
-
- SONAR_USER
|
|
20512
|
-
- SONAR_PASSWORD`);
|
|
20508
|
+
- SONAR_USER (e.g., admin)
|
|
20509
|
+
- SONAR_PASSWORD (password or token)`);
|
|
20513
20510
|
}
|
|
20514
20511
|
logger10.info(`Executing SonarQube tool: ${args.action}`, { directory });
|
|
20515
20512
|
try {
|