@jonathan0823/pi-sonarqube 0.1.2 → 0.1.3
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 +15 -11
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +352 -51
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +411 -52
package/README.md
CHANGED
|
@@ -34,11 +34,11 @@ Inside a project directory, run:
|
|
|
34
34
|
/sonarqube init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
For monorepos, you can
|
|
37
|
+
For monorepos, you can point at a path directly:
|
|
38
38
|
|
|
39
39
|
```
|
|
40
|
-
/sonarqube init
|
|
41
|
-
/sonarqube init
|
|
40
|
+
/sonarqube init apps/web
|
|
41
|
+
/sonarqube init apps/api
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Pi will ask you for:
|
|
@@ -47,14 +47,14 @@ Pi will ask you for:
|
|
|
47
47
|
- **Project key** (default: derived from directory name)
|
|
48
48
|
- **Token** (optional, used when your server requires auth)
|
|
49
49
|
|
|
50
|
-
The config is saved to `<project>/.pi/sonarqube.json`.
|
|
50
|
+
The config is saved to `<project>/.pi/sonarqube.json`.
|
|
51
51
|
|
|
52
52
|
### 2. Run analysis
|
|
53
53
|
|
|
54
54
|
```
|
|
55
55
|
/sonarqube analyze
|
|
56
|
-
/sonarqube analyze fe
|
|
57
56
|
/sonarqube analyze apps/web
|
|
57
|
+
/sonarqube analyze apps/api
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Pi will:
|
|
@@ -68,26 +68,28 @@ Pi will:
|
|
|
68
68
|
|
|
69
69
|
```
|
|
70
70
|
/sonarqube issues
|
|
71
|
-
/sonarqube issues
|
|
71
|
+
/sonarqube issues apps/web
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
Use **Up/Down** to move, **Enter** to preview the affected source code, and **Esc** to close.
|
|
75
75
|
|
|
76
|
+
Tip: Tab-complete `/sonarqube` subcommands and filters in the editor.
|
|
77
|
+
|
|
76
78
|
### 4. Open a specific issue
|
|
77
79
|
|
|
78
80
|
```
|
|
79
81
|
/sonarqube open 3
|
|
80
|
-
/sonarqube open
|
|
82
|
+
/sonarqube open apps/web 3
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
## Commands
|
|
84
86
|
|
|
85
87
|
| Command | Description |
|
|
86
88
|
| -------------------------------- | ----------------------------------------------- |
|
|
87
|
-
| `/sonarqube init [
|
|
88
|
-
| `/sonarqube analyze [target]` | Run analysis for
|
|
89
|
+
| `/sonarqube init [path]` | Set up project config for a path |
|
|
90
|
+
| `/sonarqube analyze [target]` | Run analysis for a target or path |
|
|
89
91
|
| `/sonarqube issues [target]` | Browse the latest analysis results for a target |
|
|
90
|
-
| `/sonarqube open [target] <n>` | Preview source at issue #n
|
|
92
|
+
| `/sonarqube open [target] <n>` | Preview source at issue #n |
|
|
91
93
|
|
|
92
94
|
## Tool (for the LLM)
|
|
93
95
|
|
|
@@ -97,7 +99,9 @@ The extension also registers a `sonarqube` tool that the LLM can call with actio
|
|
|
97
99
|
- `issues` — list issues
|
|
98
100
|
- `open` — open an issue with its index
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
The tool accepts optional issue filters (`severities`, `statuses`, `types`, `rules`) so the agent can fetch just blocker/critical context.
|
|
103
|
+
|
|
104
|
+
Use paths directly.
|
|
101
105
|
|
|
102
106
|
## Configuration sources (precedence order)
|
|
103
107
|
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface SonarAnalysisState {
|
|
|
19
19
|
dashboardUrl?: string;
|
|
20
20
|
ceTaskUrl?: string;
|
|
21
21
|
analysisId?: string;
|
|
22
|
+
filters?: SonarIssueFetchOptions;
|
|
22
23
|
totalIssues: number;
|
|
23
24
|
issues: SonarIssue[];
|
|
24
25
|
}
|
|
@@ -29,6 +30,12 @@ export interface SonarProjectConfig {
|
|
|
29
30
|
token?: string;
|
|
30
31
|
hasProperties: boolean;
|
|
31
32
|
}
|
|
33
|
+
export interface SonarIssueFetchOptions {
|
|
34
|
+
severities?: string[];
|
|
35
|
+
statuses?: string[];
|
|
36
|
+
types?: string[];
|
|
37
|
+
rules?: string[];
|
|
38
|
+
}
|
|
32
39
|
export interface SonarInitConfig {
|
|
33
40
|
serverUrl: string;
|
|
34
41
|
projectKey: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,iCAAiC,CAAC;AAUzC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjE,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE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