Repository navigation
Expand file tree
/
Copy pathcodeint.schema.json
More file actions
521 lines (521 loc) · 17.6 KB
/
Copy pathcodeint.schema.json
File metadata and controls
521 lines (521 loc) · 17.6 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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
{
"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."
},
"boundaries": {
"$ref": "#/$defs/BoundariesFile",
"description": "Architectural import boundaries defining named zones, optional public_files entry points, directional allow or deny rules, and optional strict_zones mode."
},
"duplication": {
"$ref": "#/$defs/DuplicationConfigFile",
"description": "Settings for Duplication detection, including opt-in shingle-based near-clone detection. Exact Clone groups remain the default when omitted."
},
"entry_points": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative paths treated as additional Production entry points for Orphan files detection, combined with manifest-discovered entry points."
}
},
"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
},
"boundaries": {
"type": "number",
"format": "double",
"description": "The highest Boundaries ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"orphan_files": {
"type": "number",
"format": "double",
"description": "The highest Orphan files 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."
},
"boundaries": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Boundaries in every Source set."
},
"orphan_files": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Orphan files 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."
},
"boundaries": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Boundaries in this Source set."
},
"orphan_files": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Orphan files 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
}
}
},
"BoundariesFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"preset": {
"$ref": "#/$defs/BoundaryPreset",
"description": "Optional built-in architecture preset (\"layered\" or \"hexagonal\") providing default zones and rules that can be overridden or extended by zones and rules."
},
"zones": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/BoundaryZoneFile"
},
"description": "Named architectural zones, each defined by repository-relative path globs and optional public_files globs.",
"default": {}
},
"rules": {
"type": "array",
"items": {
"$ref": "#/$defs/BoundaryRuleFile"
},
"description": "Directional allow or deny import rules between architectural zones."
},
"strict_zones": {
"type": "boolean",
"description": "When true, report files in evaluated Source sets that do not match any configured zone."
},
"source_sets": {
"type": "array",
"items": {
"$ref": "#/$defs/BoundarySourceSet"
},
"description": "Source sets evaluated by boundary rules; defaults to [\"production\"] when omitted or empty."
}
}
},
"BoundaryPreset": {
"type": "string",
"enum": [
"layered",
"hexagonal"
]
},
"BoundaryZoneFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"patterns": {
"type": "array",
"items": {
"type": "string"
},
"description": "Repository-relative path globs that assign files to this architectural zone."
},
"public_files": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional repository-relative path globs naming the only files in this zone that other zones may import."
}
},
"required": [
"patterns"
]
},
"BoundaryRuleFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"from": {
"type": "string",
"description": "Source zone name, or \"*\" to match any zone without a specific rule."
},
"allow": {
"type": "array",
"items": {
"type": "string"
},
"description": "Target zone names (or \"*\") that the source zone is allowed to import. Mutually exclusive with deny."
},
"deny": {
"type": "array",
"items": {
"type": "string"
},
"description": "Target zone names (or \"*\") that the source zone is forbidden to import. Mutually exclusive with allow."
},
"reason": {
"type": "string",
"description": "Optional human-readable explanation shown in boundary Findings."
}
},
"required": [
"from"
]
},
"BoundarySourceSet": {
"type": "string",
"enum": [
"production",
"test",
"generated",
"vendored"
]
},
"DuplicationConfigFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"near_clones": {
"type": "boolean",
"description": "When true, detect near-duplicate code blocks using shingle similarity in addition to exact Clone groups; false by default."
},
"min_similarity": {
"type": "number",
"format": "double",
"description": "Minimum Jaccard shingle similarity in (0, 1] required for two blocks to match as a near-clone; 0.85 by default.",
"maximum": 1,
"exclusiveMinimum": 0
}
}
}
}
}