opencode-sonarqube 1.2.42 → 1.2.44
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 +9 -21
- package/dist/index.js +3 -17
- 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
|
|
@@ -16,7 +16,6 @@ OpenCode Plugin for SonarQube integration - Enterprise-level code quality from t
|
|
|
16
16
|
- **Security Hotspots**: Review and track security hotspots requiring manual review
|
|
17
17
|
- **Quality Gate Integration**: Shows pass/fail status with detailed metrics
|
|
18
18
|
- **Git Integration**: Detects git operations and suggests quality checks
|
|
19
|
-
- **Pre-commit Validation**: Warns about blockers before commit (enterprise mode)
|
|
20
19
|
- **System Prompt Injection**: AI always knows current quality status
|
|
21
20
|
- **Toast Notifications**: Visual feedback on analysis completion
|
|
22
21
|
- **Session Compaction**: Preserves analysis state across session compaction
|
|
@@ -122,9 +121,6 @@ Create `.sonarqube/config.json` in your project root:
|
|
|
122
121
|
"level": "enterprise",
|
|
123
122
|
"autoAnalyze": true,
|
|
124
123
|
"autoFix": false,
|
|
125
|
-
"sources": "src",
|
|
126
|
-
"tests": "tests",
|
|
127
|
-
"exclusions": "**/node_modules/**,**/dist/**",
|
|
128
124
|
"newCodeDefinition": "previous_version"
|
|
129
125
|
}
|
|
130
126
|
```
|
|
@@ -140,22 +136,17 @@ Create `.sonarqube/config.json` in your project root:
|
|
|
140
136
|
| `projectName` | `string` | auto | Display name on SonarQube |
|
|
141
137
|
| `qualityGate` | `string` | `"Sonar way"` | Quality gate to use |
|
|
142
138
|
| `newCodeDefinition` | `"previous_version"` \| `"number_of_days"` \| `"reference_branch"` \| `"specific_analysis"` | `"previous_version"` | How to define 'new code' |
|
|
143
|
-
| `sources` | `string` | `"
|
|
144
|
-
| `tests` | `string` | - | Test directories (
|
|
139
|
+
| `sources` | `string` | `"."` | Source directory (always scans entire project) |
|
|
140
|
+
| `tests` | `string` | - | Test directories (auto-detected) |
|
|
145
141
|
| `exclusions` | `string` | - | File exclusion patterns (glob) |
|
|
146
|
-
| `analyzeBeforeCommit` | `boolean` | `true` | Run analysis before git commit |
|
|
147
|
-
| `blockCommit` | `boolean` | `false` | Block commit if blocking issues exist |
|
|
148
|
-
| `blockPush` | `boolean` | `false` | Block push if blocking issues exist |
|
|
149
|
-
| `blockingSeverity` | `"BLOCKER"` \| `"CRITICAL"` \| `"MAJOR"` \| `"MINOR"` \| `"INFO"` | `"CRITICAL"` | Minimum severity that blocks operations |
|
|
150
|
-
| `fixBeforeCommit` | `boolean` | `false` | Attempt auto-fix before commit |
|
|
151
142
|
|
|
152
143
|
### Strictness Levels
|
|
153
144
|
|
|
154
145
|
| Level | Behavior |
|
|
155
146
|
|-------|----------|
|
|
156
|
-
| `enterprise` | All rules active,
|
|
157
|
-
| `standard` | Major+ rules,
|
|
158
|
-
| `relaxed` | Only blocker/critical
|
|
147
|
+
| `enterprise` | All rules active, full analysis, requires 80%+ coverage for validation |
|
|
148
|
+
| `standard` | Major+ rules, balanced analysis |
|
|
149
|
+
| `relaxed` | Only blocker/critical issues reported |
|
|
159
150
|
| `off` | Plugin disabled |
|
|
160
151
|
|
|
161
152
|
### Example Configurations
|
|
@@ -173,8 +164,7 @@ Create `.sonarqube/config.json` in your project root:
|
|
|
173
164
|
```json
|
|
174
165
|
{
|
|
175
166
|
"level": "standard",
|
|
176
|
-
"autoAnalyze": true
|
|
177
|
-
"sources": "src,lib"
|
|
167
|
+
"autoAnalyze": true
|
|
178
168
|
}
|
|
179
169
|
```
|
|
180
170
|
|
|
@@ -261,8 +251,6 @@ The plugin automatically handles many scenarios without user intervention:
|
|
|
261
251
|
|-----------|-------------------|
|
|
262
252
|
| `git pull` / `git merge` | Suggests checking for new issues |
|
|
263
253
|
| `git checkout` (with changes) | Suggests running analysis |
|
|
264
|
-
| `git commit` (enterprise mode) | Warns/blocks if BLOCKER/CRITICAL issues exist |
|
|
265
|
-
| `git push` (enterprise mode) | Warns/blocks if BLOCKER/CRITICAL issues exist |
|
|
266
254
|
| `git push` | Shows notification that code was pushed |
|
|
267
255
|
|
|
268
256
|
### System Prompt Injection
|
|
@@ -491,8 +479,8 @@ This project maintains enterprise-level quality:
|
|
|
491
479
|
|
|
492
480
|
| Metric | Value |
|
|
493
481
|
|--------|-------|
|
|
494
|
-
| Test Coverage |
|
|
495
|
-
| Tests |
|
|
482
|
+
| Test Coverage | 96% |
|
|
483
|
+
| Tests | 632 |
|
|
496
484
|
| Bugs | 0 |
|
|
497
485
|
| Vulnerabilities | 0 |
|
|
498
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(),
|
|
@@ -19581,12 +19576,7 @@ ${result.message}`;
|
|
|
19581
19576
|
autoAnalyze: true,
|
|
19582
19577
|
autoFix: true,
|
|
19583
19578
|
sources: config2.sources || "src",
|
|
19584
|
-
newCodeDefinition: "previous_version"
|
|
19585
|
-
analyzeBeforeCommit: true,
|
|
19586
|
-
blockCommit: true,
|
|
19587
|
-
blockPush: true,
|
|
19588
|
-
blockingSeverity: "CRITICAL",
|
|
19589
|
-
fixBeforeCommit: true
|
|
19579
|
+
newCodeDefinition: "previous_version"
|
|
19590
19580
|
};
|
|
19591
19581
|
await Bun.write(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
19592
19582
|
logger7.info("Created default config.json", { path: configPath });
|
|
@@ -19604,11 +19594,7 @@ ${result.message}`;
|
|
|
19604
19594
|
lines.push(`- Quality Gate: ${result.qualityGate}`);
|
|
19605
19595
|
}
|
|
19606
19596
|
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
|
-
}
|
|
19597
|
+
lines.push("", projectStatusMessage, "", 'Run with action: "analyze" to start code analysis.');
|
|
19612
19598
|
return lines.join(`
|
|
19613
19599
|
`);
|
|
19614
19600
|
}
|