opencode-sonarqube 0.1.11 → 0.1.13
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 +30 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -20159,19 +20159,46 @@ function shouldIgnoreFile2(filePath) {
|
|
|
20159
20159
|
return IGNORED_FILE_PATTERNS2.some((pattern) => pattern.test(filePath));
|
|
20160
20160
|
}
|
|
20161
20161
|
var SonarQubePlugin = async ({ client, directory, worktree }) => {
|
|
20162
|
-
debugLog.info("=== PLUGIN START ===", { directory, worktree });
|
|
20162
|
+
debugLog.info("=== PLUGIN START ===", { directory, worktree, cwd: process.cwd() });
|
|
20163
|
+
const resolveValidDirectory = () => {
|
|
20164
|
+
if (worktree && worktree !== "/" && worktree.length > 1) {
|
|
20165
|
+
return worktree;
|
|
20166
|
+
}
|
|
20167
|
+
if (directory && directory !== "/" && directory.length > 1) {
|
|
20168
|
+
return directory;
|
|
20169
|
+
}
|
|
20170
|
+
const cwd = process.cwd();
|
|
20171
|
+
if (cwd && cwd !== "/" && cwd.length > 1) {
|
|
20172
|
+
return cwd;
|
|
20173
|
+
}
|
|
20174
|
+
try {
|
|
20175
|
+
const pluginPath = import.meta.url.replace("file://", "");
|
|
20176
|
+
const pathParts = pluginPath.split("/");
|
|
20177
|
+
const nodeModulesIndex = pathParts.findIndex((p) => p === "node_modules");
|
|
20178
|
+
if (nodeModulesIndex > 0) {
|
|
20179
|
+
const projectPath = pathParts.slice(0, nodeModulesIndex).join("/");
|
|
20180
|
+
if (projectPath && projectPath !== "/" && projectPath.length > 1) {
|
|
20181
|
+
return projectPath;
|
|
20182
|
+
}
|
|
20183
|
+
}
|
|
20184
|
+
} catch {}
|
|
20185
|
+
const homeDir = process.env["HOME"] || "/Users";
|
|
20186
|
+
return homeDir;
|
|
20187
|
+
};
|
|
20188
|
+
const effectiveDirectory = resolveValidDirectory();
|
|
20189
|
+
debugLog.info("Resolved directory", { original: directory, effective: effectiveDirectory });
|
|
20163
20190
|
await client.app.log({
|
|
20164
20191
|
body: {
|
|
20165
20192
|
service: "opencode-sonarqube",
|
|
20166
20193
|
level: "info",
|
|
20167
20194
|
message: "SonarQube plugin initialized",
|
|
20168
|
-
extra: { directory, worktree }
|
|
20195
|
+
extra: { directory, worktree, effectiveDirectory }
|
|
20169
20196
|
}
|
|
20170
20197
|
});
|
|
20171
20198
|
let pluginConfig;
|
|
20172
20199
|
let lastAnalysisResult;
|
|
20173
20200
|
const getConfig = () => pluginConfig;
|
|
20174
|
-
const getDirectory = () =>
|
|
20201
|
+
const getDirectory = () => effectiveDirectory;
|
|
20175
20202
|
const loadPluginConfig = async () => {
|
|
20176
20203
|
debugLog.info("loadPluginConfig called", { hasExistingConfig: !!pluginConfig });
|
|
20177
20204
|
if (pluginConfig) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-sonarqube",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "OpenCode Plugin for SonarQube integration - Enterprise-level code quality from the start",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"homepage": "https://github.com/mguttmann/opencode-sonarqube#readme",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@opencode-ai/plugin": "^1.1.34",
|
|
41
|
-
"opencode-sonarqube": "0.1.
|
|
41
|
+
"opencode-sonarqube": "0.1.12",
|
|
42
42
|
"zod": "^3.24.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|