opencode-sonarqube 1.2.3 → 1.2.4
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 +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20733,19 +20733,27 @@ Git operation completed with changes. Consider running:
|
|
|
20733
20733
|
await loadPluginConfig();
|
|
20734
20734
|
}
|
|
20735
20735
|
const isBashTool = input.tool === "bash" || input.tool === "mcp_bash";
|
|
20736
|
-
|
|
20736
|
+
safeLog(`[pre-check] tool=${input.tool}, isBash=${isBashTool}, sessionId=${currentSessionId}`);
|
|
20737
|
+
if (isBashTool) {
|
|
20737
20738
|
const args = output.args;
|
|
20738
20739
|
const command = args?.command ?? "";
|
|
20740
|
+
safeLog(`[pre-check] command: ${command.substring(0, 50)}...`);
|
|
20739
20741
|
if (/git\s+commit\b/.test(command) && !/--amend/.test(command)) {
|
|
20742
|
+
safeLog(`[pre-check] Detected git commit, running quality check...`);
|
|
20740
20743
|
const result = await handleGitOperationCheck(output, "commit");
|
|
20741
|
-
if (result.block) {
|
|
20742
|
-
|
|
20744
|
+
if (result.block && args) {
|
|
20745
|
+
args.command = `echo "\uD83D\uDEAB BLOCKED BY SONARQUBE: ${result.message || "Quality gate failed"}" && exit 1`;
|
|
20746
|
+
safeLog(`[pre-check] Commit BLOCKED - command replaced`);
|
|
20747
|
+
await showToast("Commit blocked by SonarQube quality gate!", "error");
|
|
20743
20748
|
}
|
|
20744
20749
|
}
|
|
20745
20750
|
if (/git\s+push\b/.test(command)) {
|
|
20751
|
+
safeLog(`[pre-check] Detected git push, running quality check...`);
|
|
20746
20752
|
const result = await handleGitOperationCheck(output, "push");
|
|
20747
|
-
if (result.block) {
|
|
20748
|
-
|
|
20753
|
+
if (result.block && args) {
|
|
20754
|
+
args.command = `echo "\uD83D\uDEAB BLOCKED BY SONARQUBE: ${result.message || "Quality gate failed"}" && exit 1`;
|
|
20755
|
+
safeLog(`[pre-check] Push BLOCKED - command replaced`);
|
|
20756
|
+
await showToast("Push blocked by SonarQube quality gate!", "error");
|
|
20749
20757
|
}
|
|
20750
20758
|
}
|
|
20751
20759
|
}
|