opencode-sonarqube 1.2.43 → 1.2.45
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/README.md +2 -2
- package/dist/index.js +3 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ OpenCode Plugin for SonarQube integration - Enterprise-level code quality from t
|
|
|
4
4
|
|
|
5
5
|
[](https://sonarqube.example.com)
|
|
6
6
|
[](https://sonarqube.example.com)
|
|
7
|
-
[](https://sonarqube.example.com)
|
|
8
8
|
[](./LICENSE)
|
|
9
9
|
|
|
10
10
|
## Features
|
|
@@ -480,7 +480,7 @@ This project maintains enterprise-level quality:
|
|
|
480
480
|
| Metric | Value |
|
|
481
481
|
|--------|-------|
|
|
482
482
|
| Test Coverage | 96% |
|
|
483
|
-
| Tests |
|
|
483
|
+
| Tests | 616 |
|
|
484
484
|
| Bugs | 0 |
|
|
485
485
|
| Vulnerabilities | 0 |
|
|
486
486
|
| Code Smells | 0 |
|
package/dist/index.js
CHANGED
|
@@ -4057,12 +4057,7 @@ var init_types2 = __esm(() => {
|
|
|
4057
4057
|
newCodeDefinition: exports_external2.enum(["previous_version", "number_of_days", "reference_branch", "specific_analysis"]).default("previous_version").describe("How to define 'new code' for analysis"),
|
|
4058
4058
|
sources: exports_external2.string().default("src").describe("Source directories to analyze"),
|
|
4059
4059
|
tests: exports_external2.string().optional().describe("Test directories"),
|
|
4060
|
-
exclusions: exports_external2.string().optional().describe("File exclusion patterns")
|
|
4061
|
-
analyzeBeforeCommit: exports_external2.boolean().default(true).describe("Run analysis before git commit"),
|
|
4062
|
-
blockCommit: exports_external2.boolean().default(false).describe("Block commit if BLOCKER/CRITICAL issues exist"),
|
|
4063
|
-
blockPush: exports_external2.boolean().default(false).describe("Block push if BLOCKER/CRITICAL issues exist"),
|
|
4064
|
-
blockingSeverity: exports_external2.enum(["BLOCKER", "CRITICAL", "MAJOR", "MINOR", "INFO"]).default("CRITICAL").describe("Minimum severity that blocks operations"),
|
|
4065
|
-
fixBeforeCommit: exports_external2.boolean().default(false).describe("Attempt auto-fix before commit")
|
|
4060
|
+
exclusions: exports_external2.string().optional().describe("File exclusion patterns")
|
|
4066
4061
|
});
|
|
4067
4062
|
ProjectStateSchema = exports_external2.object({
|
|
4068
4063
|
projectKey: exports_external2.string(),
|
|
@@ -19104,20 +19099,6 @@ async function runAnalysis(config2, state, options, directory) {
|
|
|
19104
19099
|
function formatAnalysisResult(result) {
|
|
19105
19100
|
return formatIssuesForAgent(result.formattedIssues, result.qualityGateStatus);
|
|
19106
19101
|
}
|
|
19107
|
-
function shouldBlockOnResult(result, level) {
|
|
19108
|
-
if (level === "off")
|
|
19109
|
-
return false;
|
|
19110
|
-
switch (level) {
|
|
19111
|
-
case "enterprise":
|
|
19112
|
-
return result.qualityGateStatus === "ERROR" || result.issues.blocker > 0 || result.issues.critical > 0;
|
|
19113
|
-
case "standard":
|
|
19114
|
-
return result.issues.blocker > 0 || result.issues.critical > 0;
|
|
19115
|
-
case "relaxed":
|
|
19116
|
-
return result.issues.blocker > 0;
|
|
19117
|
-
default:
|
|
19118
|
-
return false;
|
|
19119
|
-
}
|
|
19120
|
-
}
|
|
19121
19102
|
// src/bootstrap/index.ts
|
|
19122
19103
|
init_types2();
|
|
19123
19104
|
init_state();
|
|
@@ -19581,12 +19562,7 @@ ${result.message}`;
|
|
|
19581
19562
|
autoAnalyze: true,
|
|
19582
19563
|
autoFix: true,
|
|
19583
19564
|
sources: config2.sources || "src",
|
|
19584
|
-
newCodeDefinition: "previous_version"
|
|
19585
|
-
analyzeBeforeCommit: true,
|
|
19586
|
-
blockCommit: true,
|
|
19587
|
-
blockPush: true,
|
|
19588
|
-
blockingSeverity: "CRITICAL",
|
|
19589
|
-
fixBeforeCommit: true
|
|
19565
|
+
newCodeDefinition: "previous_version"
|
|
19590
19566
|
};
|
|
19591
19567
|
await Bun.write(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
19592
19568
|
logger7.info("Created default config.json", { path: configPath });
|
|
@@ -19604,11 +19580,7 @@ ${result.message}`;
|
|
|
19604
19580
|
lines.push(`- Quality Gate: ${result.qualityGate}`);
|
|
19605
19581
|
}
|
|
19606
19582
|
const projectStatusMessage = result.isNewProject ? "A new project was created on your SonarQube server." : "Connected to existing project on SonarQube server.";
|
|
19607
|
-
|
|
19608
|
-
lines.push("", projectStatusMessage, "", 'Run with action: "analyze" to start code analysis.');
|
|
19609
|
-
} else {
|
|
19610
|
-
lines.push("", "**Pre-commit blocking enabled** - commits with critical issues will be blocked.", "", projectStatusMessage, "", 'Run with action: "analyze" to start code analysis.');
|
|
19611
|
-
}
|
|
19583
|
+
lines.push("", projectStatusMessage, "", 'Run with action: "analyze" to start code analysis.');
|
|
19612
19584
|
return lines.join(`
|
|
19613
19585
|
`);
|
|
19614
19586
|
}
|
|
@@ -19658,13 +19630,6 @@ async function handleAnalyze(config2, state, projectKey, args, directory) {
|
|
|
19658
19630
|
}
|
|
19659
19631
|
}
|
|
19660
19632
|
}
|
|
19661
|
-
if (shouldBlockOnResult(result, config2.level)) {
|
|
19662
|
-
output += `
|
|
19663
|
-
|
|
19664
|
-
---
|
|
19665
|
-
|
|
19666
|
-
**[BLOCKING]** Quality gate failed or critical issues found. Please fix before proceeding.`;
|
|
19667
|
-
}
|
|
19668
19633
|
return output;
|
|
19669
19634
|
}
|
|
19670
19635
|
async function handleIssues(config2, state, projectKey, args) {
|