Repository navigation
Expand file tree
/
Copy pathcodeint.schema.json
More file actions
353 lines (353 loc) · 11.9 KB
/
Copy pathcodeint.schema.json
File metadata and controls
353 lines (353 loc) · 11.9 KB
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
{
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": [
"string",
"null"
],
"description": "The address of this JSON schema, for editors; codeint does not read it.",
"default": null
},
"source_sets": {
"$ref": "#/$defs/SourceSetGlobs",
"description": "Globs of repository-relative paths that put files into a Source set, whatever the Source set rules say. When globs of several Source sets match one file, the first of vendored, generated, test, and production wins.",
"default": {
"production": [],
"test": [],
"generated": [],
"vendored": []
}
},
"budgets": {
"$ref": "#/$defs/SourceSetBudgets",
"description": "The highest ratio each Metric may reach in each Source set; a Metric over its Budget fails the run with exit code 1. A ratio equal to its Budget passes. Codeint compares the ratio as the report shows it, rounded to 4 decimal places.",
"default": {
"production": {},
"test": {},
"generated": {},
"vendored": {}
}
},
"regression_limits": {
"$ref": "#/$defs/RegressionLimitsFile",
"description": "How much each Metric may get worse from the merge-base to the head side before codeint diff reports a Regression and exits with code 1. A key named after a Metric sets its limit in every Source set; a key named after a Source set sets limits for that Source set only. For each setting, the limit of the Source set wins over the limit of the Metric, and a setting left out keeps the default: a ratio rise of 0.01, and new Findings fail only with a numerator rise, except for Import cycles, where any new Finding fails.",
"default": {}
},
"languages": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/LanguageGlobs"
},
"description": "Which Language plugin measures which folders. Each entry names a Language plugin, the globs of the folders or files it measures, and the globs it leaves out. Several entries may name one Language plugin; it measures what any of them includes. Without this key, every Language plugin measures the whole repository; with it, a Language plugin measures only what its entries include."
},
"plugins": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginEntry"
},
"description": "External WebAssembly component Language and Metric plugins to load from local paths or HTTPS URLs. Each entry names the plugin, its optional kind (language by default, or metric), either its local path or its HTTPS url, and its required SHA-256 hex digest."
},
"plugin_limits": {
"$ref": "#/$defs/PluginLimitsFile",
"description": "Memory cap and time limit enforced on each WebAssembly Plugin. Defaults are 64 MiB and 5000 ms."
}
},
"title": "codeint.json",
"description": "The configuration of codeint, read from codeint.json at the root of the repository.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"SourceSetGlobs": {
"type": "object",
"additionalProperties": false,
"properties": {
"production": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Production Source set.",
"default": []
},
"test": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Test Source set.",
"default": []
},
"generated": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Generated Source set.",
"default": []
},
"vendored": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Vendored Source set.",
"default": []
}
}
},
"SourceSetBudgets": {
"type": "object",
"additionalProperties": false,
"properties": {
"production": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Production Source set.",
"default": {}
},
"test": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Test Source set.",
"default": {}
},
"generated": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Generated Source set.",
"default": {}
},
"vendored": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Vendored Source set.",
"default": {}
}
}
},
"MetricBudgets": {
"type": "object",
"properties": {
"erosion": {
"type": "number",
"format": "double",
"description": "The highest Erosion ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"duplication": {
"type": "number",
"format": "double",
"description": "The highest Duplication ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"verbosity": {
"type": "number",
"format": "double",
"description": "The highest Verbosity ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"import_cycles": {
"type": "number",
"format": "double",
"description": "The highest Import cycles ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
}
},
"additionalProperties": {
"$ref": "#/$defs/Budget"
}
},
"Budget": {
"type": "number",
"format": "double",
"minimum": 0,
"maximum": 1
},
"RegressionLimitsFile": {
"type": "object",
"properties": {
"erosion": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Erosion in every Source set."
},
"duplication": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Duplication in every Source set."
},
"verbosity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Verbosity in every Source set."
},
"import_cycles": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Import cycles in every Source set."
},
"production": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Production Source set."
},
"test": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Test Source set."
},
"generated": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Generated Source set."
},
"vendored": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Vendored Source set."
}
},
"additionalProperties": {
"$ref": "#/$defs/RegressionLimitSetting"
}
},
"RegressionLimitSetting": {
"type": "object",
"additionalProperties": false,
"properties": {
"ratio_rise": {
"type": "number",
"format": "double",
"description": "The highest rise of the ratio, from 0 to 1, as the report shows it, rounded to 4 decimal places. A rise equal to the limit passes.",
"minimum": 0,
"maximum": 1
},
"new_findings": {
"$ref": "#/$defs/NewFindingsRule",
"description": "When new Findings fail: any_new_finding fails on any new Finding; numerator_rise_with_new_findings fails only when the numerator rises too, so a Finding that only moves passes; never lets new Findings pass, so that with ratio_rise 1 this Metric never makes a Regression here."
}
}
},
"NewFindingsRule": {
"type": "string",
"enum": [
"any_new_finding",
"numerator_rise_with_new_findings",
"never"
]
},
"MetricRegressionLimits": {
"type": "object",
"properties": {
"erosion": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Erosion in this Source set."
},
"duplication": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Duplication in this Source set."
},
"verbosity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Verbosity in this Source set."
},
"import_cycles": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Import cycles in this Source set."
}
},
"additionalProperties": {
"$ref": "#/$defs/RegressionLimitSetting"
}
},
"LanguageGlobs": {
"type": "object",
"additionalProperties": false,
"properties": {
"plugin": {
"type": "string",
"description": "The name of the Language plugin, such as typescript-javascript."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative folders or files that the Language plugin measures; a folder covers every file below it."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative folders or files inside the included ones that the Language plugin leaves out.",
"default": []
}
},
"required": [
"plugin",
"include"
]
},
"PluginEntry": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of the external Plugin."
},
"kind": {
"$ref": "#/$defs/PluginKind",
"description": "Whether the external Plugin is a Language plugin or a Metric plugin; language by default.",
"default": "language"
},
"path": {
"type": [
"string",
"null"
],
"description": "Path to the WebAssembly component file, relative to the repository root or absolute. Set either path or url, not both."
},
"url": {
"type": [
"string",
"null"
],
"description": "HTTPS URL of the WebAssembly component file. Set either path or url, not both."
},
"sha256": {
"type": "string",
"description": "The required 64-character hexadecimal SHA-256 digest of the plugin file."
}
},
"required": [
"name",
"sha256"
]
},
"PluginKind": {
"type": "string",
"enum": [
"language",
"metric"
]
},
"PluginLimitsFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory_mb": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "Maximum linear memory in MiB that a WebAssembly Plugin may allocate; 64 by default.",
"maximum": 4096
},
"timeout_ms": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "Maximum wall-clock time in milliseconds for each WebAssembly Plugin call; 5000 by default.",
"maximum": 300000
}
}
}
}
}