@critiq/cli 0.0.1

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.
@@ -0,0 +1,386 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "RuleDocumentV0Alpha1",
4
+ "type": "object",
5
+ "properties": {
6
+ "apiVersion": {
7
+ "type": "string",
8
+ "const": "critiq.dev/v1alpha1"
9
+ },
10
+ "kind": {
11
+ "type": "string",
12
+ "const": "Rule"
13
+ },
14
+ "metadata": {
15
+ "type": "object",
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "title": {
22
+ "$ref": "#/properties/metadata/properties/id"
23
+ },
24
+ "summary": {
25
+ "$ref": "#/properties/metadata/properties/id"
26
+ },
27
+ "rationale": {
28
+ "$ref": "#/properties/metadata/properties/id"
29
+ },
30
+ "tags": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "#/properties/metadata/properties/id"
34
+ }
35
+ },
36
+ "status": {
37
+ "$ref": "#/properties/metadata/properties/id"
38
+ },
39
+ "stability": {
40
+ "type": "string",
41
+ "enum": [
42
+ "stable",
43
+ "experimental"
44
+ ]
45
+ },
46
+ "appliesTo": {
47
+ "type": "string",
48
+ "enum": [
49
+ "block",
50
+ "function",
51
+ "file",
52
+ "project"
53
+ ]
54
+ }
55
+ },
56
+ "required": [
57
+ "id",
58
+ "title",
59
+ "summary"
60
+ ],
61
+ "additionalProperties": false
62
+ },
63
+ "scope": {
64
+ "type": "object",
65
+ "properties": {
66
+ "languages": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string",
70
+ "enum": [
71
+ "typescript",
72
+ "javascript",
73
+ "ts",
74
+ "js",
75
+ "python",
76
+ "go",
77
+ "java",
78
+ "php",
79
+ "ruby",
80
+ "rust",
81
+ "all"
82
+ ]
83
+ }
84
+ },
85
+ "paths": {
86
+ "type": "object",
87
+ "properties": {
88
+ "include": {
89
+ "type": "array",
90
+ "items": {
91
+ "$ref": "#/properties/metadata/properties/id"
92
+ }
93
+ },
94
+ "exclude": {
95
+ "type": "array",
96
+ "items": {
97
+ "$ref": "#/properties/metadata/properties/id"
98
+ }
99
+ }
100
+ },
101
+ "additionalProperties": false
102
+ },
103
+ "changedLinesOnly": {
104
+ "type": "boolean"
105
+ }
106
+ },
107
+ "required": [
108
+ "languages"
109
+ ],
110
+ "additionalProperties": false
111
+ },
112
+ "match": {
113
+ "anyOf": [
114
+ {
115
+ "type": "object",
116
+ "properties": {
117
+ "all": {
118
+ "type": "array",
119
+ "items": {
120
+ "$ref": "#/properties/match"
121
+ }
122
+ }
123
+ },
124
+ "required": [
125
+ "all"
126
+ ],
127
+ "additionalProperties": false
128
+ },
129
+ {
130
+ "type": "object",
131
+ "properties": {
132
+ "any": {
133
+ "type": "array",
134
+ "items": {
135
+ "$ref": "#/properties/match"
136
+ }
137
+ }
138
+ },
139
+ "required": [
140
+ "any"
141
+ ],
142
+ "additionalProperties": false
143
+ },
144
+ {
145
+ "type": "object",
146
+ "properties": {
147
+ "not": {
148
+ "$ref": "#/properties/match"
149
+ }
150
+ },
151
+ "required": [
152
+ "not"
153
+ ],
154
+ "additionalProperties": false
155
+ },
156
+ {
157
+ "type": "object",
158
+ "properties": {
159
+ "node": {
160
+ "type": "object",
161
+ "properties": {
162
+ "kind": {
163
+ "$ref": "#/properties/metadata/properties/id"
164
+ },
165
+ "bind": {
166
+ "$ref": "#/properties/metadata/properties/id"
167
+ },
168
+ "where": {
169
+ "type": "array",
170
+ "items": {
171
+ "anyOf": [
172
+ {
173
+ "type": "object",
174
+ "properties": {
175
+ "path": {
176
+ "$ref": "#/properties/metadata/properties/id"
177
+ },
178
+ "equals": {
179
+ "anyOf": [
180
+ {
181
+ "$ref": "#/properties/metadata/properties/id"
182
+ },
183
+ {
184
+ "type": "boolean"
185
+ }
186
+ ]
187
+ }
188
+ },
189
+ "required": [
190
+ "path",
191
+ "equals"
192
+ ],
193
+ "additionalProperties": false
194
+ },
195
+ {
196
+ "type": "object",
197
+ "properties": {
198
+ "path": {
199
+ "$ref": "#/properties/metadata/properties/id"
200
+ },
201
+ "in": {
202
+ "type": "array",
203
+ "items": {
204
+ "$ref": "#/properties/metadata/properties/id"
205
+ },
206
+ "minItems": 1
207
+ }
208
+ },
209
+ "required": [
210
+ "path",
211
+ "in"
212
+ ],
213
+ "additionalProperties": false
214
+ },
215
+ {
216
+ "type": "object",
217
+ "properties": {
218
+ "path": {
219
+ "$ref": "#/properties/metadata/properties/id"
220
+ },
221
+ "matches": {
222
+ "$ref": "#/properties/metadata/properties/id"
223
+ }
224
+ },
225
+ "required": [
226
+ "path",
227
+ "matches"
228
+ ],
229
+ "additionalProperties": false
230
+ },
231
+ {
232
+ "type": "object",
233
+ "properties": {
234
+ "path": {
235
+ "$ref": "#/properties/metadata/properties/id"
236
+ },
237
+ "exists": {
238
+ "type": "boolean"
239
+ }
240
+ },
241
+ "required": [
242
+ "path",
243
+ "exists"
244
+ ],
245
+ "additionalProperties": false
246
+ }
247
+ ]
248
+ }
249
+ }
250
+ },
251
+ "required": [
252
+ "kind"
253
+ ],
254
+ "additionalProperties": false
255
+ }
256
+ },
257
+ "required": [
258
+ "node"
259
+ ],
260
+ "additionalProperties": false
261
+ },
262
+ {
263
+ "type": "object",
264
+ "properties": {
265
+ "ancestor": {
266
+ "$ref": "#/properties/match/anyOf/3/properties/node"
267
+ }
268
+ },
269
+ "required": [
270
+ "ancestor"
271
+ ],
272
+ "additionalProperties": false
273
+ },
274
+ {
275
+ "type": "object",
276
+ "properties": {
277
+ "fact": {
278
+ "$ref": "#/properties/match/anyOf/3/properties/node"
279
+ }
280
+ },
281
+ "required": [
282
+ "fact"
283
+ ],
284
+ "additionalProperties": false
285
+ }
286
+ ]
287
+ },
288
+ "emit": {
289
+ "type": "object",
290
+ "properties": {
291
+ "finding": {
292
+ "type": "object",
293
+ "properties": {
294
+ "category": {
295
+ "type": "string",
296
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*$"
297
+ },
298
+ "severity": {
299
+ "type": "string",
300
+ "enum": [
301
+ "low",
302
+ "medium",
303
+ "high",
304
+ "critical"
305
+ ]
306
+ },
307
+ "confidence": {
308
+ "anyOf": [
309
+ {
310
+ "type": "string",
311
+ "enum": [
312
+ "low",
313
+ "medium",
314
+ "high"
315
+ ]
316
+ },
317
+ {
318
+ "type": "number",
319
+ "minimum": 0,
320
+ "maximum": 1
321
+ }
322
+ ]
323
+ },
324
+ "tags": {
325
+ "type": "array",
326
+ "items": {
327
+ "$ref": "#/properties/metadata/properties/id"
328
+ }
329
+ }
330
+ },
331
+ "required": [
332
+ "category",
333
+ "severity",
334
+ "confidence"
335
+ ],
336
+ "additionalProperties": false
337
+ },
338
+ "message": {
339
+ "type": "object",
340
+ "properties": {
341
+ "title": {
342
+ "$ref": "#/properties/metadata/properties/id"
343
+ },
344
+ "summary": {
345
+ "$ref": "#/properties/metadata/properties/id"
346
+ },
347
+ "detail": {
348
+ "$ref": "#/properties/metadata/properties/id"
349
+ }
350
+ },
351
+ "required": [
352
+ "title",
353
+ "summary"
354
+ ],
355
+ "additionalProperties": false
356
+ },
357
+ "remediation": {
358
+ "type": "object",
359
+ "properties": {
360
+ "summary": {
361
+ "$ref": "#/properties/metadata/properties/id"
362
+ }
363
+ },
364
+ "required": [
365
+ "summary"
366
+ ],
367
+ "additionalProperties": false
368
+ }
369
+ },
370
+ "required": [
371
+ "finding",
372
+ "message"
373
+ ],
374
+ "additionalProperties": false
375
+ }
376
+ },
377
+ "required": [
378
+ "apiVersion",
379
+ "kind",
380
+ "metadata",
381
+ "scope",
382
+ "match",
383
+ "emit"
384
+ ],
385
+ "additionalProperties": false
386
+ }