-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathqodana.ts
289 lines (288 loc) · 8.33 KB
/
qodana.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
/**
* The Qodana CLI repo: https://github.com/JetBrains/qodana-cli
*/
const icon = "fig://template?badge=🔧";
const completionSpec: Fig.Spec = {
name: "qodana",
description: "Run Qodana as fast as possible, with minimum effort required",
options: [
{
name: ["-h", "--help"],
description: "Show help page for command",
isPersistent: true,
priority: 1,
},
{
name: ["-v", "--version"],
description: "Version for Qodana",
},
],
subcommands: [
{
name: "init",
description: "Configure project for Qodana",
icon,
priority: 100,
options: [
{
name: ["-i", "--project-dir"],
description:
'Root directory of the project to configure (default ".")',
args: {
name: "string",
template: "folders",
},
},
],
},
{
name: "scan",
description: "Scan a project with Qodana",
icon,
priority: 99,
options: [
{
name: ["-a", "--analysis-id"],
description:
"Unique report identifier (GUID) to be used by Qodana Cloud",
args: {
name: "string",
},
},
{
name: ["-b", "--baseline"],
description:
"Provide the path to an existing SARIF report to be used in the baseline state calculation",
args: {
name: "string",
},
},
{
name: "--baseline-include-absent",
description:
"Include in the output report the results from the baseline run that are absent in the current run",
},
{
name: "--cache-dir",
description:
"Override cache directory (default <userCacheDir>/JetBrains/<linter>/cache)",
args: {
name: "string",
},
},
{
name: ["-c", "--changes"],
description: "Override the docker image to be used for the analysis",
},
{
name: "--clear-cache",
description:
"Clear the local Qodana cache before running the analysis",
},
{
name: "--disable-sanity",
description:
"Skip running the inspections configured by the sanity profile",
},
{
name: ["-e", "--env"],
description:
"Define additional environment variables for the Qodana container (you can use the flag multiple times). CLI is not reading full host environment variables and does not pass it to the Qodana container for security reasons",
isRepeatable: true,
args: {
name: "stringArray",
},
},
{
name: "--fail-threshold",
description:
"Set the number of problems that will serve as a quality gate. If this number is reached, the inspection run is terminated with a non-zero exit code",
args: {
name: "string",
},
},
{
name: ["-l", "--linter"],
description: "Override linter to use",
args: {
name: "string",
},
},
{
name: "--port",
description: "Port to serve the report on (default 8080)",
args: {
name: "int",
},
},
{
name: "--print-problems",
description: "Print all found problems by Qodana in the CLI output",
},
{
name: ["-n", "--profile-name"],
description: "Profile name defined in the project",
args: {
name: "string",
},
},
{
name: ["-p", "--profile-path"],
description: "Path to the profile file",
args: {
name: "string",
template: "filepaths",
},
},
{
name: ["-i", "--project-dir"],
description: 'Root directory of the inspected project (default ".")',
args: {
name: "string",
template: "folders",
},
},
{
name: "--property",
description:
"Set a JVM property to be used while running Qodana using the --property property.name=value1,value2,...,valueN notation",
insertValue: "--property {cursor}=",
args: {
name: "stringArray",
},
},
{
name: ["-o", "--results-dir"],
description:
"Override directory to save Qodana inspection results to (default <userCacheDir>/JetBrains/<linter>/results)",
args: {
name: "string",
},
},
{
name: "--run-promo",
description:
"Set to 'true' to have the application run the inspections configured by the promo profile; set to 'false' otherwise (default: 'true' only if Qodana is executed with the default profile)",
args: {
name: "string",
suggestions: ["true", "false"],
},
},
{
name: ["-s", "--save-report"],
description: "Generate HTML report (default true)",
priority: 99,
},
{
name: "--script",
description: 'Override the run scenario (default "default")',
args: {
name: "string",
},
},
{
name: "--send-report",
description:
"Send the inspection report to Qodana Cloud, requires the '--token' option to be specified",
dependsOn: ["--token"],
},
{
name: ["-w", "--show-report"],
description: "Serve HTML report on port",
priority: 100,
},
{
name: "--skip-pull",
description: "Skip pulling the latest Qodana container",
},
{
name: ["-d", "--source-directory"],
description:
"Directory inside the project-dir directory must be inspected. If not specified, the whole project is inspected",
args: {
name: "string",
},
},
{
name: "--stub-profile",
description:
"Absolute path to the fallback profile file. This option is applied in case the profile was not specified using any available options",
args: {
name: "string",
},
},
{
name: ["-u", "--user"],
description:
"User to run Qodana container as. Please specify user id – '$UID' or user id and group id $(id -u):$(id -g). Use 'root' to run as the root user (default: the current user)",
args: {
name: "string",
},
},
{
name: ["-v", "--volume"],
description:
"Define additional volumes for the Qodana container (you can use the flag multiple times)",
isRepeatable: true,
args: {
name: "string",
},
},
],
},
{
name: "show",
description: "Show Qodana report",
icon,
priority: 98,
options: [
{
name: ["-d", "--dir-only"],
description: "Open report directory only, don't serve it",
},
{
name: ["-p", "--port"],
description: "Specify port to serve report at (default 8080)",
priority: 100,
args: {
name: "int",
},
},
{
name: ["-i", "--project-dir"],
description: 'Root directory of the inspected project (default ".")',
args: {
name: "string",
template: "folders",
},
},
{
name: ["-r", "--report-dir"],
description:
"Specify HTML report path (the one with index.html inside) (default <userCacheDir>/JetBrains/<linter>/results/report)",
args: {
name: "string",
template: "folders",
},
},
],
},
{
name: "view",
description: "View SARIF files in CLI",
icon,
priority: 97,
options: [
{
name: ["-f", "--sarif-file"],
description: 'Path to the SARIF file (default "./qodana.sarif.json")',
args: {
name: "string",
template: "filepaths",
},
},
],
},
],
};
export default completionSpec;