-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathschema.json
More file actions
2278 lines (2278 loc) · 73.2 KB
/
Copy pathschema.json
File metadata and controls
2278 lines (2278 loc) · 73.2 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
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "FallowConfig",
"type": "object",
"properties": {
"$schema": {
"type": [
"string",
"null"
],
"writeOnly": true
},
"extends": {
"type": "array",
"items": {
"type": "string"
},
"writeOnly": true
},
"entry": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"ignorePatterns": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"framework": {
"type": "array",
"items": {
"$ref": "#/$defs/ExternalPluginDef"
},
"default": []
},
"workspaces": {
"anyOf": [
{
"$ref": "#/$defs/WorkspaceConfig"
},
{
"type": "null"
}
],
"default": null
},
"ignoreDependencies": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"ignoreUnresolvedImports": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"ignoreExports": {
"type": "array",
"items": {
"$ref": "#/$defs/IgnoreExportRule"
},
"default": []
},
"ignoreCatalogReferences": {
"type": "array",
"items": {
"$ref": "#/$defs/IgnoreCatalogReferenceRule"
}
},
"ignoreDependencyOverrides": {
"type": "array",
"items": {
"$ref": "#/$defs/IgnoreDependencyOverrideRule"
}
},
"ignoreExportsUsedInFile": {
"$ref": "#/$defs/IgnoreExportsUsedInFileConfig",
"default": false
},
"ignoreDecorators": {
"type": "array",
"items": {
"type": "string"
}
},
"usedClassMembers": {
"type": "array",
"items": {
"$ref": "#/$defs/UsedClassMemberRule"
},
"default": []
},
"duplicates": {
"$ref": "#/$defs/DuplicatesConfig",
"default": {
"enabled": true,
"mode": "mild",
"minTokens": 50,
"minLines": 5,
"minOccurrences": 2,
"threshold": 0.0,
"ignore": [],
"ignoreDefaults": true,
"skipLocal": false,
"crossLanguage": false,
"ignoreImports": true,
"normalization": {},
"minCorpusSizeForShingleFilter": 1024,
"minCorpusSizeForTokenCache": 5000
}
},
"health": {
"$ref": "#/$defs/HealthConfig",
"default": {
"maxCyclomatic": 20,
"maxCognitive": 15,
"maxCrap": 30.0,
"crapRefactorBand": 5,
"coverage": null,
"coverageRoot": null,
"ignore": [],
"ownership": {
"botPatterns": [
"*\\[bot\\]*",
"dependabot*",
"renovate*",
"github-actions*",
"svc-*",
"*-service-account*"
],
"emailMode": "handle"
},
"suggestInlineSuppression": true
}
},
"rules": {
"$ref": "#/$defs/RulesConfig",
"default": {
"unused-files": "error",
"unused-exports": "error",
"unused-types": "error",
"private-type-leaks": "off",
"unused-dependencies": "error",
"unused-dev-dependencies": "warn",
"unused-optional-dependencies": "warn",
"unused-enum-members": "error",
"unused-class-members": "error",
"unused-store-members": "warn",
"unprovided-injects": "warn",
"unrendered-components": "warn",
"unused-component-props": "warn",
"unused-component-emits": "warn",
"unused-component-inputs": "warn",
"unused-component-outputs": "warn",
"unused-svelte-events": "warn",
"unused-server-actions": "warn",
"unused-load-data-keys": "warn",
"prop-drilling": "off",
"thin-wrapper": "off",
"duplicate-prop-shape": "off",
"unresolved-imports": "error",
"unlisted-dependencies": "error",
"duplicate-exports": "error",
"type-only-dependencies": "warn",
"test-only-dependencies": "warn",
"circular-dependencies": "error",
"re-export-cycle": "warn",
"boundary-violation": "error",
"coverage-gaps": "off",
"feature-flags": "off",
"stale-suppressions": "warn",
"unused-catalog-entries": "warn",
"empty-catalog-groups": "warn",
"unresolved-catalog-references": "error",
"unused-dependency-overrides": "warn",
"misconfigured-dependency-overrides": "error",
"security-client-server-leak": "off",
"security-sink": "off",
"policy-violation": "warn",
"invalid-client-export": "warn",
"mixed-client-server-barrel": "warn",
"misplaced-directive": "warn",
"route-collision": "error",
"dynamic-segment-name-conflict": "error"
}
},
"boundaries": {
"$ref": "#/$defs/BoundaryConfig",
"default": {
"zones": [],
"rules": []
}
},
"flags": {
"$ref": "#/$defs/FlagsConfig",
"default": {
"configObjectHeuristics": false
}
},
"security": {
"$ref": "#/$defs/SecurityConfig",
"default": {}
},
"fix": {
"$ref": "#/$defs/FixConfig",
"default": {
"catalog": {
"deletePrecedingComments": "auto"
}
}
},
"resolve": {
"$ref": "#/$defs/ResolveConfig",
"default": {}
},
"production": {
"$ref": "#/$defs/ProductionConfig",
"default": false
},
"plugins": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"rulePacks": {
"description": "Paths to declarative rule-pack files (JSON or JSONC), relative to the\nproject root. Each pack declares `banned-call` / `banned-import` rules\nthat report as `policy-violation` findings. Packs are pure data: no\nproject code is executed. Invalid or missing packs fail config load.",
"type": "array",
"items": {
"type": "string"
}
},
"dynamicallyLoaded": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"overrides": {
"type": "array",
"items": {
"$ref": "#/$defs/ConfigOverride"
},
"default": []
},
"codeowners": {
"type": [
"string",
"null"
]
},
"publicPackages": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"regression": {
"anyOf": [
{
"$ref": "#/$defs/RegressionConfig"
},
{
"type": "null"
}
]
},
"audit": {
"$ref": "#/$defs/AuditConfig"
},
"sealed": {
"type": "boolean",
"default": false
},
"includeEntryExports": {
"type": "boolean",
"default": false
},
"autoImports": {
"type": "boolean",
"default": false
},
"cache": {
"$ref": "#/$defs/CacheConfig"
}
},
"additionalProperties": false,
"$defs": {
"ExternalPluginDef": {
"description": "A declarative plugin definition loaded from a standalone file or inline config.\n\nExternal plugins provide the same static pattern capabilities as built-in\nplugins (entry points, always-used files, used exports, tooling dependencies),\nbut are defined in standalone files or inline in the fallow config rather than\ncompiled Rust code.\n\nThey cannot do AST-based config parsing (`resolve_config()`), but cover the\nvast majority of framework integration use cases.\n\nSupports JSONC, JSON, and TOML formats. All use camelCase field names.\n\n```json\n{\n \"$schema\": \"https://raw.githubusercontent.com/fallow-rs/fallow/main/plugin-schema.json\",\n \"name\": \"my-framework\",\n \"enablers\": [\"my-framework\", \"@my-framework/core\"],\n \"entryPoints\": [\"src/routes/**/*.{ts,tsx}\"],\n \"configPatterns\": [\"my-framework.config.{ts,js}\"],\n \"alwaysUsed\": [\"src/setup.ts\"],\n \"toolingDependencies\": [\"my-framework-cli\"],\n \"usedExports\": [\n { \"pattern\": \"src/routes/**/*.{ts,tsx}\", \"exports\": [\"default\", \"loader\", \"action\"] }\n ]\n}\n```",
"type": "object",
"properties": {
"name": {
"description": "Unique name for this plugin.",
"type": "string"
},
"detection": {
"description": "Rich detection logic (dependency checks, file existence, boolean combinators).\nTakes priority over `enablers` when set.",
"anyOf": [
{
"$ref": "#/$defs/PluginDetection"
},
{
"type": "null"
}
],
"default": null
},
"enablers": {
"description": "Package names that activate this plugin when found in package.json.\nSupports exact matches and prefix patterns (ending with `/`).\nOnly used when `detection` is not set.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"entryPoints": {
"description": "Glob patterns for entry point files.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"entryPointRole": {
"description": "Coverage role for `entryPoints`.\n\nDefaults to `support`. Set to `runtime` for application entry points\nor `test` for test framework entry points.",
"$ref": "#/$defs/EntryPointRole",
"default": "support"
},
"configPatterns": {
"description": "Glob patterns for config files (marked as always-used when active).",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"alwaysUsed": {
"description": "Files that are always considered \"used\" when this plugin is active.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"toolingDependencies": {
"description": "Dependencies that are tooling (used via CLI/config, not source imports).\nThese should not be flagged as unused devDependencies.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"usedExports": {
"description": "Exports that are always considered used for matching file patterns.",
"type": "array",
"items": {
"$ref": "#/$defs/ExternalUsedExport"
},
"default": []
},
"usedClassMembers": {
"description": "Class member method/property rules the framework invokes at runtime.\nSupports plain member names for global suppression and scoped objects\nwith `extends` / `implements` constraints when the method name is too\ncommon to suppress across the whole workspace.",
"type": "array",
"items": {
"$ref": "#/$defs/UsedClassMemberRule"
},
"default": []
}
},
"required": [
"name"
]
},
"PluginDetection": {
"description": "How to detect if a plugin should be activated.\n\nWhen set on an `ExternalPluginDef`, this takes priority over `enablers`.\nSupports dependency checks, file existence checks, and boolean combinators.",
"oneOf": [
{
"description": "Plugin detected if this package is in dependencies.",
"type": "object",
"properties": {
"package": {
"type": "string"
},
"type": {
"type": "string",
"const": "dependency"
}
},
"required": [
"type",
"package"
]
},
{
"description": "Plugin detected if this file pattern matches.",
"type": "object",
"properties": {
"pattern": {
"type": "string"
},
"type": {
"type": "string",
"const": "fileExists"
}
},
"required": [
"type",
"pattern"
]
},
{
"description": "All conditions must be true.",
"type": "object",
"properties": {
"conditions": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginDetection"
}
},
"type": {
"type": "string",
"const": "all"
}
},
"required": [
"type",
"conditions"
]
},
{
"description": "Any condition must be true.",
"type": "object",
"properties": {
"conditions": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginDetection"
}
},
"type": {
"type": "string",
"const": "any"
}
},
"required": [
"type",
"conditions"
]
}
]
},
"EntryPointRole": {
"description": "How a plugin's discovered entry points contribute to coverage reachability.",
"oneOf": [
{
"description": "Runtime/application roots that should count toward runtime reachability.",
"type": "string",
"const": "runtime"
},
{
"description": "Test roots that should count toward test reachability.",
"type": "string",
"const": "test"
},
{
"description": "Support/setup/config roots that should keep files alive but not count as runtime/test.",
"type": "string",
"const": "support"
}
]
},
"ExternalUsedExport": {
"description": "Exports considered used for files matching a pattern.",
"type": "object",
"properties": {
"pattern": {
"description": "Glob pattern for files.",
"type": "string"
},
"exports": {
"description": "Export names always considered used.",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"pattern",
"exports"
]
},
"UsedClassMemberRule": {
"description": "A `usedClassMembers` entry from config or an external plugin.\n\nSupports either a plain member name or glob pattern (`\"agInit\"`,\n`\"enter*\"`) or a scoped rule that only applies when a class matches\nspecific `extends` / `implements` heritage clauses.",
"anyOf": [
{
"description": "Globally suppress this class member name or glob pattern for all classes.",
"type": "string"
},
{
"description": "Suppress these class member names only for matching classes.",
"$ref": "#/$defs/ScopedUsedClassMemberRule"
}
]
},
"ScopedUsedClassMemberRule": {
"description": "A heritage-constrained `usedClassMembers` rule.",
"type": "object",
"properties": {
"extends": {
"description": "Only apply when the class extends this parent class name.",
"type": [
"string",
"null"
]
},
"implements": {
"description": "Only apply when the class implements this interface name.",
"type": [
"string",
"null"
]
},
"members": {
"description": "Member names or glob patterns that should be treated as framework-used.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"members"
]
},
"WorkspaceConfig": {
"description": "Workspace configuration for monorepo support.",
"type": "object",
"properties": {
"patterns": {
"description": "Additional workspace patterns (beyond what's in root package.json).",
"type": "array",
"items": {
"type": "string"
},
"default": []
}
}
},
"IgnoreExportRule": {
"description": "Rule for ignoring specific exports.",
"type": "object",
"properties": {
"file": {
"description": "Glob pattern for files.",
"type": "string"
},
"exports": {
"description": "Export names to ignore (`*` for all).",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"file",
"exports"
]
},
"IgnoreCatalogReferenceRule": {
"description": "Rule for suppressing an `unresolved-catalog-reference` finding.",
"type": "object",
"properties": {
"package": {
"type": "string"
},
"catalog": {
"type": [
"string",
"null"
]
},
"consumer": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false,
"required": [
"package"
]
},
"IgnoreDependencyOverrideRule": {
"description": "Rule for suppressing dependency-override findings.",
"type": "object",
"properties": {
"package": {
"type": "string"
},
"source": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false,
"required": [
"package"
]
},
"IgnoreExportsUsedInFileConfig": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/$defs/IgnoreExportsUsedInFileByKind"
}
]
},
"IgnoreExportsUsedInFileByKind": {
"type": "object",
"properties": {
"type": {
"type": "boolean",
"default": false
},
"interface": {
"type": "boolean",
"default": false
}
}
},
"DuplicatesConfig": {
"description": "Configuration for code duplication detection.",
"type": "object",
"properties": {
"enabled": {
"description": "Whether duplication detection is enabled.",
"type": "boolean",
"default": true
},
"mode": {
"description": "Detection mode: strict, mild, weak, or semantic.",
"$ref": "#/$defs/DetectionMode",
"default": "mild"
},
"minTokens": {
"description": "Minimum number of tokens for a clone.",
"type": "integer",
"format": "uint",
"minimum": 0,
"default": 50
},
"minLines": {
"description": "Minimum number of lines for a clone.",
"type": "integer",
"format": "uint",
"minimum": 0,
"default": 5
},
"minOccurrences": {
"description": "Minimum number of occurrences (instances of the same clone) before a\ngroup is reported. Defaults to 2 (every duplicated pair is reported).\nRaise this to focus on widespread copy-paste worth refactoring and skip\ncontext-sensitive pairs.",
"type": "integer",
"format": "uint",
"minimum": 2,
"default": 2
},
"threshold": {
"description": "Maximum allowed duplication percentage (0 = no limit).",
"type": "number",
"format": "double",
"default": 0.0
},
"ignore": {
"description": "Additional ignore patterns for duplication analysis.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"ignoreDefaults": {
"description": "Merge built-in generated-framework ignore patterns with `ignore`.\n\nSet to `false` to use only the user-provided `ignore` list.",
"type": "boolean",
"default": true
},
"skipLocal": {
"description": "Only report cross-directory duplicates.",
"type": "boolean",
"default": false
},
"crossLanguage": {
"description": "Enable cross-language clone detection by stripping type annotations.\n\nWhen enabled, TypeScript type annotations (parameter types, return types,\ngenerics, interfaces, type aliases) are stripped from the token stream,\nallowing detection of clones between `.ts` and `.js` files.",
"type": "boolean",
"default": false
},
"ignoreImports": {
"description": "Exclude module-wiring declarations from clone detection.\n\nDefaults to `true`: token-identical module wiring is a structural\nproperty of well-formatted code, not copy-paste, so it should not\nsurface as clone groups. Set to `false` to count module wiring again.\nWhen enabled, ES imports, re-export declarations, and top-level static\nCommonJS `require(\"...\")` binding declarations are stripped from the\ntoken stream before clone detection. Dynamic imports, side-effect\n`require()` calls, nested `require()` calls, dynamic require arguments,\nand mixed declarations are still counted.",
"type": "boolean",
"default": true
},
"normalization": {
"description": "Fine-grained normalization overrides on top of the detection mode.",
"$ref": "#/$defs/NormalizationConfig",
"default": {}
},
"minCorpusSizeForShingleFilter": {
"description": "Minimum tokenized file count before focused duplicate analysis prefilters\nunchanged files with k-token shingles.",
"type": "integer",
"format": "uint",
"minimum": 0,
"default": 1024
},
"minCorpusSizeForTokenCache": {
"description": "Minimum source file count before the persistent duplication token cache\nactivates. Below this threshold the cache load/save overhead exceeds the\ntokenize savings, so the cache stays disabled even when not running with\n`--no-cache`.",
"type": "integer",
"format": "uint",
"minimum": 0,
"default": 5000
}
}
},
"DetectionMode": {
"description": "Detection mode controlling how aggressively tokens are normalized.\n\nSince fallow uses AST-based tokenization (not lexer-based), whitespace and\ncomments are inherently absent from the token stream. The `Strict` and `Mild`\nmodes are currently equivalent. `Weak` mode additionally blinds string\nliterals. `Semantic` mode blinds all identifiers and literal values for\nType-2 (renamed variable) clone detection.",
"oneOf": [
{
"description": "All tokens preserved including identifier names and literal values (Type-1 only).",
"type": "string",
"const": "strict"
},
{
"description": "Default mode -- equivalent to strict for AST-based tokenization.",
"type": "string",
"const": "mild"
},
{
"description": "Blind string literal values (structure-preserving).",
"type": "string",
"const": "weak"
},
{
"description": "Blind all identifiers and literal values for structural (Type-2) detection.",
"type": "string",
"const": "semantic"
}
]
},
"NormalizationConfig": {
"description": "Fine-grained normalization overrides.\n\nEach option, when set to `Some(true)`, forces that normalization regardless of\nthe detection mode. When set to `Some(false)`, it forces preservation. When\n`None`, the detection mode's default behavior applies.",
"type": "object",
"properties": {
"ignoreIdentifiers": {
"description": "Blind all identifiers (variable names, function names, etc.) to the same hash.\nDefault in `semantic` mode.",
"type": [
"boolean",
"null"
]
},
"ignoreStringValues": {
"description": "Blind string literal values to the same hash.\nDefault in `weak` and `semantic` modes.",
"type": [
"boolean",
"null"
]
},
"ignoreNumericValues": {
"description": "Blind numeric literal values to the same hash.\nDefault in `semantic` mode.",
"type": [
"boolean",
"null"
]
}
}
},
"HealthConfig": {
"description": "Configuration for complexity health metrics (`fallow health`).",
"type": "object",
"properties": {
"maxCyclomatic": {
"description": "Maximum allowed cyclomatic complexity per function (default: 20).\nFunctions exceeding this threshold are reported.",
"type": "integer",
"format": "uint16",
"minimum": 0,
"maximum": 65535,
"default": 20
},
"maxCognitive": {
"description": "Maximum allowed cognitive complexity per function (default: 15).\nFunctions exceeding this threshold are reported.",
"type": "integer",
"format": "uint16",
"minimum": 0,
"maximum": 65535,
"default": 15
},
"maxCrap": {
"description": "Maximum allowed CRAP (Change Risk Anti-Patterns) score per function\n(default: 30.0). CRAP combines cyclomatic complexity with test\ncoverage: high complexity plus low coverage produces a high CRAP\nscore. Functions meeting or exceeding this threshold are reported.\nUse `--coverage` with Istanbul data for accurate per-function CRAP;\notherwise fallow estimates coverage from the module graph.",
"type": "number",
"format": "double",
"default": 30.0
},
"crapRefactorBand": {
"description": "Band below `maxCyclomatic` where CRAP-only findings also receive a\nsecondary `refactor-function` action (default: 5). Set to `0` to only\nsuggest refactoring when cyclomatic already meets the configured\nthreshold.",
"type": "integer",
"format": "uint16",
"minimum": 0,
"maximum": 65535,
"default": 5
},
"coverage": {
"description": "Path to Istanbul-format coverage data for accurate per-function CRAP\nscores. Relative paths resolve against the project root. The CLI\n`--coverage` flag and `FALLOW_COVERAGE` environment variable override\nthis value.",
"type": [
"string",
"null"
],
"default": null
},
"coverageRoot": {
"description": "Absolute prefix to strip from Istanbul file paths before CRAP matching.\nUse when coverage was generated under a different checkout root in CI\nor Docker. The CLI `--coverage-root` flag and `FALLOW_COVERAGE_ROOT`\nenvironment variable override this value.",
"type": [
"string",
"null"
],
"default": null
},
"ignore": {
"description": "Glob patterns to exclude from complexity analysis.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"thresholdOverrides": {
"description": "Per-file or per-function threshold overrides. These keep exceptional\nfunctions visible as configured numeric ceilings instead of hiding them\nbehind binary suppressions.",
"type": "array",
"items": {
"$ref": "#/$defs/HealthThresholdOverride"
}
},
"ownership": {
"description": "Ownership analysis configuration. Controls bot filtering and email\nprivacy mode for `--ownership` output.",
"$ref": "#/$defs/OwnershipConfig",
"default": {
"botPatterns": [
"*\\[bot\\]*",
"dependabot*",
"renovate*",
"github-actions*",
"svc-*",
"*-service-account*"
],
"emailMode": "handle"
}
},
"suggestInlineSuppression": {
"description": "Whether health JSON output emits `suppress-line` action hints\nalongside complexity findings (default: `true`). Set to `false` to\nopt out across the project: useful for teams that manage suppressions\nexclusively through `// fallow-ignore-*` comments authored by hand or\nthrough the `fallow.suppress` LSP code action, but who do not want\nCI-driven `suppress-line` action hints in their JSON output.\n`--baseline` activates auto-omission regardless of this setting,\nsince baseline files are a separate suppression mechanism.",
"type": "boolean",
"default": true
}
},
"additionalProperties": false
},
"HealthThresholdOverride": {
"description": "Per-file or per-function health threshold override.",
"type": "object",
"properties": {
"files": {
"description": "Project-root-relative file globs this override applies to.",
"type": "array",
"items": {
"type": "string"
}
},
"functions": {
"description": "Exact emitted function names this override applies to. Empty means every\nfunction in matching files.",
"type": "array",
"items": {
"type": "string"
}
},
"maxCyclomatic": {
"description": "Local cyclomatic complexity ceiling.",
"type": [
"integer",
"null"
],
"format": "uint16",
"minimum": 0,
"maximum": 65535
},
"maxCognitive": {
"description": "Local cognitive complexity ceiling.",
"type": [
"integer",
"null"
],
"format": "uint16",
"minimum": 0,
"maximum": 65535
},
"maxCrap": {
"description": "Local CRAP ceiling.",
"type": [
"number",
"null"
],
"format": "double"
},
"reason": {
"description": "Human-readable rationale for the exception.",
"type": [
"string",
"null"
]
}
},
"additionalProperties": false,
"required": [
"files"
]
},
"OwnershipConfig": {
"description": "Configuration for ownership analysis (`fallow health --hotspots --ownership`).",
"type": "object",
"properties": {
"botPatterns": {
"description": "Glob patterns (matched against the author email local-part) that\nidentify bot or service-account commits to exclude from ownership\nsignals. Overrides the defaults entirely when set.",
"type": "array",
"items": {
"type": "string"
},
"default": [
"*\\[bot\\]*",
"dependabot*",
"renovate*",
"github-actions*",
"svc-*",
"*-service-account*"
]
},
"emailMode": {
"description": "Privacy mode for emitted author emails. Defaults to `handle`.\nOverride on the CLI via `--ownership-emails=raw|handle|anonymized`.\nThe legacy spelling `hash` is still accepted for compatibility.",
"$ref": "#/$defs/EmailMode",
"default": "handle"
}
}
},
"EmailMode": {
"description": "Privacy mode for author emails emitted in ownership output.\n\nDefaults to `handle` (local-part only, no domain) so SARIF and JSON\nartifacts do not leak raw email addresses into CI pipelines.",
"oneOf": [
{
"description": "Show the raw email address as it appears in git history.\nUse for public repositories where history is already exposed.",
"type": "string",
"const": "raw"
},
{
"description": "Show the local-part only (before the `@`). Mailmap-resolved where possible.\nDefault. Balances readability and privacy.",
"type": "string",
"const": "handle"
},
{
"description": "Show a stable `xxh3:<16hex>` pseudonym derived from the raw email.\nNon-cryptographic; suitable to keep raw emails out of CI artifacts\n(SARIF, code-scanning uploads) but not as a security primitive:\na known list of org emails can be brute-forced into a rainbow table.\nUse in regulated environments where even local-parts are sensitive.",
"type": "string",
"const": "anonymized"
},
{
"description": "Legacy spelling for [`EmailMode::Anonymized`].",
"type": "string",
"const": "hash"
}
]
},
"RulesConfig": {
"description": "Per-issue-type severity configuration.\n\nControls which issue types cause CI failure, are reported as warnings,\nor are suppressed entirely. Most fields default to `Severity::Error`.\n\nRule names use kebab-case in config files (e.g., `\"unused-files\": \"error\"`).",
"type": "object",
"properties": {
"unused-files": {
"$ref": "#/$defs/Severity",
"default": "error"
},