-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllCode.globalconfig
More file actions
2649 lines (2025 loc) · 132 KB
/
Copy pathAllCode.globalconfig
File metadata and controls
2649 lines (2025 loc) · 132 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
# MikeNakis.CommonFiles/AllCode.globalconfig
#
# This is a "Global AnalyzerConfig"
# See https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig
is_global = true
#######################################################################################################################
# Severities for dotnet diagnostics:
# error - Violations appear as build errors and cause builds to fail.
# warning - Violations appear as build warnings but do not cause builds to fail (unless you have an option set to
# treat warnings as errors).
# suggestion - Violations appear as build messages and as suggestions in the Visual Studio IDE.
# PEARL: no, they do not appear as build messages. Only as suggestions in the IDE.
# silent - Violations aren't visible to the user.
# PEARL: this is not the whole truth: violations are not visible, but fixes are available.
# none - Rule is suppressed completely.
# PEARL: what they really mean is: violations are not visible, and fixes are not available either.
# default - The default severity of the rule is used. The default severities for each .NET release are listed in
# the roslyn-analyzers repo. In that table, "Disabled" corresponds to none, "Hidden" corresponds to
# silent, and "Info" corresponds to suggestion.
#######################################################################################################################
# "Code style" rules (IDExxxx)
# PEARL: For a long period of time IDExxxx rules were only applicable within visual studio and they ware not checked
# at all during `dotnet build`, so they would never cause the build to fail even if configured as errors.
# See https://github.com/dotnet/roslyn/issues/33558
# This seems to have been finally fixed.
# IDE0001: "Simplify name"
dotnet_diagnostic.IDE0001.severity = warning
# IDE0002: "Simplify member access"
dotnet_diagnostic.IDE0002.severity = warning
# IDE0003: "Remove this or Me qualification"
# Also see IDE0009: "Add this or Me qualification"
# For options, see IDE0009
dotnet_diagnostic.IDE0003.severity = warning
# Justification: Never use 'this' unless necessary.
# IDE0004: "Remove unnecessary cast"
dotnet_diagnostic.IDE0004.severity = warning
# IDE0005: "Remove unnecessary using directives" / "Using directive is unnecessary"
dotnet_diagnostic.IDE0005.severity = warning
# Undocumented/non-existent
dotnet_diagnostic.IDE0006.severity = error
# IDE0007: "Use 'var' instead of explicit type"
# Also see IDE0008: "Use explicit type instead of 'var'"
# For options, see IDE0008
dotnet_diagnostic.IDE0007.severity = silent
# Justification: See IDE0008
# IDE0008: "Use explicit type instead of 'var'"
# PEARL: The options of this rule somehow also control IDE0007
# Also see IDE0007: "Use 'var' instead of explicit type".
# Also see IDE0090: "Simplify `new` expression" (a.k.a. "target-typed `new`")
dotnet_diagnostic.IDE0008.severity = warning
csharp_style_var_for_built_in_types = false
csharp_style_var_elsewhere = false
# PEARL: If this option is set to `true`, analysis will never suggest IDE0090: "Simplify `new` expression"
# a.k.a. "target-typed `new`". It's okay, target-typed `new` is not that important anyway.
csharp_style_var_when_type_is_apparent = true
# Justification: Here is a rule worth living by:
# "Any choice that makes code easier to read is preferable over any choice that makes code easier to write".
# The use of `var` makes code easier to write, but not easier to read, because it often leaves the reader wondering
# what is the exact type hidden by `var`.
# Script kiddies might object that on the contrary, explicitly stating the type makes code harder to read, because
# there is extra stuff to read, and the extra stuff is unimportant. Script kiddies say this because types are
# just unnecessary noise to them. Script kiddies can go get a life.
# Therefore: never use `var` unless the type is obvious.
# The type is obvious only in the following cases:
# - when assigning a literal of a built-in type. (e.g. `var a = "covfefe";`, `var a = 42;`, `var a = 5.0;`)
# - However, there is nothing to be gained from saying var a = 5 vs. int a = 5.
# - when assigning the result of `new`. (e.g. `var a = new Foo();`)
# - However, we now have target-typed new, which allows us to say `Foo a = new()`.
# - when assigning the result of a type-cast. (e.g. `var a = (int)b;`)
# - we would like to be able to do that, but we cannot! see `csharp_style_var_when_type_is_apparent`.
# In all cases, feel free to momentarily use `var` when declaring a variable, and then immediately ask the IDE
# to refactor that `var` into the actual type.
# IDE0009: "Add this or Me qualification"
# PEARL: The options of this rule somehow also control IDE0003
# Also see IDE0003: "Remove this or Me qualification"
dotnet_diagnostic.IDE0009.severity = none
# Justification: Never use 'this' unless necessary.
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_property = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_event = false
# IDE0010: "Add missing cases to switch statement"
# Also see IDE0072: "Add missing cases to switch expression"
dotnet_diagnostic.IDE0010.severity = silent
# PEARL: At first glance this sounds like a very good rule to have, so normally, we would want to have it enabled;
# however, this rule has two rather substantial problems:
# 1. This rule unnecessarily triggers on non-exhaustible switches without a default clause. So, if we were to
# have this rule enabled, we would be forced to add redundant default clauses all over the place.
# Now, one could argue that this is a small price to pay for the benefit of receiving a warning when an
# exhaustible switch fails be exhaustive; however, get a load of this:
# 2. This rule entirely erroneously triggers on exhaustible switches WITH A default clause, requiring us to add
# missing cases despite the fact that we have explicitly stated our intention to handle missing cases via the
# 'default' clause.
# So, this rule is completely retarded and unusable. Dotnet does not offer a (usable) analysis rule that can flag
# exchaustible switch statements that fail to be exhaustive.
# IDE0011: "Add braces"
# PEARL: This rule is stupendously biased. Not only its name reflects a specific choice of `true`, but also, the only
# choice that actually works is `true`. The `false` choice does absolutely nothing.
# Furthermore, the `when_multiline` choice does not do what one might reasonably think it does; instead, it does
# something bizarre: it requires the `then` part of an `if` statement to have braces if the `else` part is
# multi-line and vice versa. (Go figure.)
# PEARL: Since configuring "Add braces" to `false` does not work, and since there is no "Remove braces" rule, we cannot
# have a warning issued when some cargo-cult programmer litters our code-base with redundant curly braces.
# This is typical Microsoft: they pretend to give you an option to choose, but they only give you one choice.
dotnet_diagnostic.IDE0011.severity = warning
# Possible values: `true`, `false`, and `when_multiline`. Default is `true`.
csharp_prefer_braces = false
# Justification: Never use braces unless necessary.
# Undocumented/non-existent
dotnet_diagnostic.IDE0012.severity = error
dotnet_diagnostic.IDE0013.severity = error
dotnet_diagnostic.IDE0014.severity = error
dotnet_diagnostic.IDE0015.severity = error
# IDE0016: "Use throw expression"
dotnet_diagnostic.IDE0016.severity = suggestion
# Possible values: `true` and `false`. Default is `true`.
csharp_style_throw_expression = true
# IDE0017: "Use object initializers" / "Simplify object initialization"
dotnet_diagnostic.IDE0017.severity = none
# Possible values: `true` and `false`. Default is `true`.
# PEARL: Adding `:<severity>` here causes silent failure. Severity can only be specified via the cryptic rule id.
dotnet_style_object_initializer = false
# IDE0018: "Inline variable declaration"
dotnet_diagnostic.IDE0018.severity = warning
# Possible values: `true` and `false`. Default is `true`.
csharp_style_inlined_variable_declaration = true
# IDE0019: "Use pattern matching to avoid 'as' followed by a 'null' check"
# Also see IDE0078: "Use pattern matching"
# Also see IDE0260: "Use pattern matching"
dotnet_diagnostic.IDE0019.severity = warning
# Possible values: `true` and `false`. Default is `true`.
# PEARL: `csharp_style_pattern_matching_over_as_with_null_check` somehow controls both IDE0019 and IDE0260.
csharp_style_pattern_matching_over_as_with_null_check = true
# IDE0020: "Use pattern matching to avoid is check followed by a cast (with variable)"
# Also see IDE0038: "Use pattern matching to avoid is check followed by a cast (without variable)"
# For options, see IDE0038
dotnet_diagnostic.IDE0020.severity = warning
# IDE0021: "Use expression body for constructors"
dotnet_diagnostic.IDE0021.severity = silent
# Possible values: "true", "false", and "when_on_single_line".
csharp_style_expression_bodied_constructors = false
# IDE0022: "Use expression body for methods"
dotnet_diagnostic.IDE0022.severity = silent
# PEARL: Adding `:<severity>` here causes silent failure. Severity can only be specified via the cryptic rule id.
csharp_style_expression_bodied_methods = when_on_single_line
# IDE0023: "Use expression body for conversion operators"
# For options, see IDE0024
dotnet_diagnostic.IDE0023.severity = warning
# IDE0024: "Use expression body for operators"
dotnet_diagnostic.IDE0024.severity = warning
# PEARL: This option applies to both IDE0023 and IDE0024
csharp_style_expression_bodied_operators = when_on_single_line
# IDE0025: "Use expression body for properties"
dotnet_diagnostic.IDE0025.severity = warning
csharp_style_expression_bodied_properties = when_on_single_line
# IDE0026: "Use expression body for indexers"
dotnet_diagnostic.IDE0026.severity = warning
csharp_style_expression_bodied_indexers = when_on_single_line
# IDE0027: "Use expression body for accessors"
dotnet_diagnostic.IDE0027.severity = warning
csharp_style_expression_bodied_accessors = when_on_single_line
# IDE0028: "Use collection initializers"
dotnet_diagnostic.IDE0028.severity = silent
dotnet_style_collection_initializer = true
# IDE0029: "Null check can be simplified (ternary conditional check)"
# See also IDE0030: "Null check can be simplified (nullable ternary conditional check)"
# See also IDE0270: "Null check can be simplified (if null check)"
dotnet_diagnostic.IDE0029.severity = suggestion
# PEARL: the `dotnet_style_coalesce_expression` option somehow controls IDE0029, IDE0030, and IDE0270
dotnet_style_coalesce_expression = true
# IDE0030: "Null check can be simplified (nullable ternary conditional check)"
# See also IDE0029: "Null check can be simplified (ternary conditional check)"
# See also IDE0270: "Null check can be simplified (if null check)"
# For options, see IDE0029
dotnet_diagnostic.IDE0030.severity = suggestion
# IDE0031: "Use null propagation"
dotnet_diagnostic.IDE0031.severity = suggestion
dotnet_style_null_propagation = true
# IDE0032: "Use auto-implemented property"
dotnet_diagnostic.IDE0032.severity = suggestion
dotnet_style_prefer_auto_properties = true
# IDE0033: "Use explicitly provided tuple name"
dotnet_diagnostic.IDE0033.severity = warning
dotnet_style_explicit_tuple_names = true
# IDE0034: "Simplify 'default' expression"
dotnet_diagnostic.IDE0034.severity = suggestion
csharp_prefer_simple_default_expression = true
# IDE0035: "Remove unreachable code"
dotnet_diagnostic.IDE0035.severity = warning
# IDE0036: "Order modifiers"
dotnet_diagnostic.IDE0036.severity = warning
csharp_preferred_modifier_order = public, private, protected, internal, file, static, extern, virtual, abstract, sealed, readonly, override, unsafe, required, volatile, async, new
# Justification:
# - 'new' must be last so as to be as close as possible to the name
# - 'readonly' must be placed before 'override'
# IDE0037: "Use inferred member names"
dotnet_diagnostic.IDE0037.severity = silent
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true
# IDE0038: "Use pattern matching to avoid is check followed by a cast (without variable)"
# See also IDE0020: "Use pattern matching to avoid is check followed by a cast (with variable)"
dotnet_diagnostic.IDE0038.severity = warning
# PEARL: 'csharp_style_pattern_matching_over_is_with_cast_check' somehow controls both IDE0020 and IDE0038
csharp_style_pattern_matching_over_is_with_cast_check = true
# IDE0039: Use local function instead of lambda
dotnet_diagnostic.IDE0039.severity = silent
csharp_style_prefer_local_over_anonymous_function = true
# Justification: lambdas are perfectly fine; we use 'silent' so as to retain the option to refactor under "quick fixes".
# IDE0040: "Add accessibility modifiers" / "Accessibility modifiers required"
# PEARL: The question that this rule deals with is not about accessibility modifiers at large, it is about accessibility
# modifiers which are the same as the defaults and therefore redundant.
# PEARL: The name of this rule is biased: it assumes we want redundant accessibility modifiers to always be added,
# whereas its very purpose of existence is precisely to give us the freedom to choose, and what we choose is the
# opposite of what its name assumes: Redundant modifiers must always be removed.
dotnet_diagnostic.IDE0040.severity = warning
dotnet_style_require_accessibility_modifiers = omit_if_default
# Justification: The language has certain default accessibilities, and it allows you to repeat them explicitly.
# Explicitly repeating the defaults is optional and redundant.
# The general rule we follow is: If something is optional and redundant, then it should be omitted.
# If it is unclear to you what the language defaults are, then go learn the language _fully_ and come back
# only when you are done.
# Additionally, there is merit in never specifying the accessibility of private methods because while
# refactoring we often try nesting and un-nesting methods, and a nested method _cannot_ have an accessibility
# modifier, so we would rather not be hit with the 'gotcha' of having to also add or remove the `private`
# modifier each time we nest / un-nest a method.
# IDE0041: "Use 'is null' check"
dotnet_diagnostic.IDE0041.severity = suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
# IDE0042: "Deconstruct variable declaration"
dotnet_diagnostic.IDE0042.severity = suggestion
csharp_style_deconstructed_variable_declaration = true
# Undocumented/non-existent
dotnet_diagnostic.IDE0043.severity = error
# IDE0044: "Add readonly modifier"
dotnet_diagnostic.IDE0044.severity = warning
dotnet_style_readonly_field = true
# IDE0045: "Use conditional expression for assignment"
# TODO: revise this.
dotnet_diagnostic.IDE0045.severity = silent
dotnet_style_prefer_conditional_expression_over_assignment = true
# IDE0046: "Use conditional expression for return" / "Convert to conditional expression"
# PEARL: If you set the severity to anything other than `none` and the preference to `true` then you gain access to the
# refactoring which converts two return statements into a single return statement with a conditional expression;
# however, if you set the preference to `false` there is no refactoring to perform the opposite conversion, and there
# exists no rule for the opposite intention.
dotnet_diagnostic.IDE0046.severity = silent
dotnet_style_prefer_conditional_expression_over_return = true
# Justification: the programmer must be free to choose whichever form they find more natural, and must not even be
# bothered with a suggestion to do the opposite of what they have chosen; thus, the severity must be either `none` or
# `silent`. The associated refactoring is nice to have, so we set the rule to `true` and the severity to `silent`.
# IDE0047: "Remove unnecessary parentheses"
# See also: IDE0048: "Add parentheses for clarity"
# For options, see IDE0048
dotnet_diagnostic.IDE0047.severity = warning
# IDE0048: "Add parentheses for clarity"
# PEARL: the options for this rule somehow also control IDE0047, and it is unclear exactly how they do so on both.
# See also: IDE0047: "Remove unnecessary parentheses"
dotnet_diagnostic.IDE0048.severity = silent
# Justification: allow developers to select the "add parentheses for clarity" quick-action, as to be able to temporarily see default precedence.
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
# IDE0049: "Use language keywords instead of framework type names for type references"
dotnet_diagnostic.IDE0049.severity = warning
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# IDE0050: "Convert anonymous type to tuple"
dotnet_diagnostic.IDE0050.severity = warning
# IDE0051: "Remove unused private member"
# Note: this is about private members that are NEITHER READ NOR WRITTEN.
# PEARL: This rule does not work for unused private methods if any of the following appears within the class,
# including within parameters to attributes of methods of that class, and even different parts of a partial class:
# - `nameof( <type> )`. (Workaround: try to use `typeof( <type> ).Name` instead, when possible.)
# - `stackalloc`. (No workaround.)
# - possibly other constructs.
# Also see IDE0082: "Convert typeof to nameof".
# PEARL: If the severity of IDE0051 is set to "warning", then the code cleanup action "Fix analyzer warnings and errors
# set in EditorConfig" will cause entire unused functions to be removed from the code! This is an extremely
# narrow-minded interpretation of the aim to only make non-breaking changes. The workaround is to never ask any "code
# quality" tools made by Microsoft to fix any issues; have them report the issues, and fix them manually.
dotnet_diagnostic.IDE0051.severity = warning
# IDE0052: "Remove unread private member"
# Note: this is about private members that are WRITTEN BUT NOT READ.
# PEARL: Under certain circumstances, IDE0052 does not work. Unread private members are not reported, and suppressions
# of such warnings are in turn flagged with IDE0079: "Remove unnecessary suppression".
# This is happening due to a compiler bug which was reported all the way back in 2021 and it has still not been
# fixed as of 2024. (See https://github.com/dotnet/roslyn/issues/54972)
dotnet_diagnostic.IDE0052.severity = warning
# IDE0053: "Use expression body for lambdas"
dotnet_diagnostic.IDE0053.severity = silent
csharp_style_expression_bodied_lambdas = true
# Justification: the programmer must be free to choose block body or expression body for a lambda, and the option to
# apply the refactoring to change the body style is nice to have.
# IDE0054: "Use compound assignment"
# Also see IDE0074: "Use coalesce compound assignment"
dotnet_diagnostic.IDE0054.severity = warning
# PEARL: `dotnet_style_prefer_compound_assignment` somehow controls both IDE0054: "Use compound assignment" and
# IDE0074: "Use coalesce compound assignment".
# PEARL: Adding `:<severity>` here causes silent failure. Severity can only be specified via the cryptic rule id.
dotnet_style_prefer_compound_assignment = true
# IDE0055: "Formatting rule"
# PEARL: this rule must be configured in .editorconfig, not in .globalconfig.
# To be fair, the documentation states that .globalconfig is meant for code analysis rules, not for formatting
# rules.
# However, this limitation appears to have been introduced in order to cover up for bugs:
# If you specify IDE0055 in .globalconfig instead of .editorconfig, the built-in formatter of Visual Studio will
# continue to work fine, and the "Format Code" option of the "Code Cleanup" command of Visual Studio will also
# continue to work fine, but `dotnet format` (or `dotnet format whitespace`) will completely mess up your code
# by applying all default formatting to it, because it is apparently unaware of .globalconfig.
# IDE0056: "Use index operator"
dotnet_diagnostic.IDE0056.severity = warning
csharp_style_prefer_index_operator = true
# IDE0057 "Use range operator"
dotnet_diagnostic.IDE0057.severity = warning
csharp_style_prefer_range_operator = true
# IDE0058: "Expression value is never used" / "Remove unnecessary expression value"
dotnet_diagnostic.IDE0058.severity = silent
csharp_style_unused_value_expression_statement_preference = discard_variable
# Justification: Invoking a function and forgetting to do something with the return value is a very common mistake and
# a source of many bugs. Therefore, some means of eradicating this mistake would be very useful.
# One way to eradicate this mistake is to introduce a rule: functions should be either pure, or impure. Pure
# functions must return a value. Impure functions must never return a value. Therefore, if a function returns a
# value, it should be an error to ignore that value.
# Unfortunately, as things are right now, we cannot establish such a rule, because many impure functions return
# values just in case the caller needs them; for example, all the StringBuilder.Append methods return the string
# builder itself so that calls can be chained.
# So, in order to introduce this rule, lots of non-value-returning extension methods must be written first.
# IDE0059 "Remove unnecessary value assignment"
# PEARL: This is supposed to do the same thing as CA1804, so it would be superfluous, except that CA1804 does not work.
# PEARL: This rule also does not work in some scenarios; for example, unused variables in nested methods.
# PEARL: This rule false-positively triggers on a local `const` declared in the middle (as opposed to the very
# beginning) of a method that contains nested methods.
# See also CA1804
dotnet_diagnostic.IDE0059.severity = warning
csharp_style_unused_value_assignment_preference = discard_variable
# IDE0060: "Remove unused parameter"
# PEARL: This does not work for unused parameters of nested methods!
# PEARL: This does not work for unused parameters of methods that contain nested methods!
# PEARL: When the severity of this rule is "warning", the command `dotnet format style` will issue a message saying:
# > Unable to fix IDE0060. No associated code fix found.
dotnet_diagnostic.IDE0060.severity = warning
dotnet_code_quality_unused_parameters = all
# IDE0061: "Use expression body for local functions"
# Valid values are true, when_on_single_line, and false (the default).
# PEARL: The visual indicators shown by Visual Studio for suggestions are usually inconspicuous, as they should be.
# However, when Visual Studio shows a suggestion indicator for this rule, it is highly conspicuous, thus
# defeating the purpose of it being a suggestion.
dotnet_diagnostic.IDE0061.severity = silent
csharp_style_expression_bodied_local_functions = when_on_single_line
# Justification: See PEARL command above.
# IDE0062: "Make local function static"
dotnet_diagnostic.IDE0062.severity = warning
csharp_prefer_static_local_function = true
# IDE0063: "Use simple 'using' statement" / "'using' statement can be simplified"
dotnet_diagnostic.IDE0063.severity = silent
# PEARL: Adding `:<severity>` here causes silent failure. Severity can only be specified via the cryptic rule id.
csharp_prefer_simple_using_statement = false
# Justification: The so-called "simple" 'using' statement is anything but simple. It _looks_ simple, but something
# looking simple and something actually being simple are two entirely unrelated things.
# The so-called "simple" 'using' statement relinquishes control over the exact moment at which disposal will happen.
# It can be okay to use in some cases, but in most cases it should be avoided. Therefore, the rules governing it must
# be very quiet about it.
# IDE0064: "Make struct fields writable"
# PEARL: This rule is brain-damaged. If it is ever triggered, it does not, of course, mean that any struct fields should
# be made writable. It means that the struct has a method that assigns to `this`, which should be avoided.
dotnet_diagnostic.IDE0064.severity = warning
# IDE0065: "'using' directive placement"
dotnet_diagnostic.IDE0065.severity = warning
csharp_using_directive_placement = inside_namespace
# Justification: This is the subject of many a heated discussion among C# programmers all over the world.
# Here is a rule worth living by: The scope of anything should be the smallest possible.
# The smallest possible scope for `using` directives is _within_ the namespace.
# Therefore, the only right place for `using` directives is within the namespace, end of story.
# TODO: revise this. It turns out to cause problems. It would not be causing any problems if every namespace import was
# prefixed with `global::`, but we cannot do that, because then we get a warning about simplifying import directives.
# IDE0066: "Use switch expression"
dotnet_diagnostic.IDE0066.severity = warning
csharp_style_prefer_switch_expression = true
# Undocumented/non-existent
dotnet_diagnostic.IDE0067.severity = error
dotnet_diagnostic.IDE0068.severity = error
dotnet_diagnostic.IDE0069.severity = error
# IDE0070: "Use 'System.HashCode.Combine'"
dotnet_diagnostic.IDE0070.severity = warning
# IDE0071: "Simplify interpolation"
# PEARL: The documentation for this rule says that it "recommends removal of certain explicit method calls, such as
# ToString() ..." which begs the question: what other method calls besides ToString() does it recommend removing?
# PEARL: Undocumented behavior:
# If the severity of this rule is set to 'silent', the invocation of `ToString()` will be faded to indicate that it
# is unnecessary. You have to set the severity to 'none' on order to avoid the fading.
dotnet_diagnostic.IDE0071.severity = silent
dotnet_style_prefer_simplified_interpolation = true
# Justification: I want to be able to use $"{foo.ToString()}" so that I can easily go to the definition of `ToString()`
# and see what it does.
# IDE0072: "Add missing cases to switch expression" / "Populate switch"
# Also see IDE0010: "Add missing cases to switch statement"
dotnet_diagnostic.IDE0072.severity = silent
# PEARL: Normally, we would want a rule which warns us about missing cases, but this particular rule will flag a switch
# statement even if it has a default clause / fall-through case, so it is useless.
# TODO: Reconsider this. Perhaps all switch statements should have a default clause / fall-through case.
# IDE0073: "Require file header"
dotnet_diagnostic.IDE0073.severity = none
file_header_template = unset
# Justification: #AintNoBodyGotNoTimeFoDat.
# IDE0074: "Use coalesce compound assignment"
# Also see IDE0054: "Use compound assignment"
# For options, see IDE0054
dotnet_diagnostic.IDE0074.severity = warning
# IDE0075: "Simplify conditional expression"
dotnet_diagnostic.IDE0075.severity = warning
dotnet_style_prefer_simplified_boolean_expressions = true
# IDE0076: "Remove invalid global 'SuppressMessageAttribute'"
dotnet_diagnostic.IDE0076.severity = error
# IDE0077: "Avoid legacy format target in global 'SuppressMessageAttribute'"
dotnet_diagnostic.IDE0077.severity = error
# IDE0078: "Use pattern matching"
# Also see IDE0019: "Use pattern matching to avoid 'as' followed by a 'null' check"
# Also see IDE0260: "Use pattern matching"
# PEARL: This diagnostic has the same name as IDE0260: "Use pattern matching"
dotnet_diagnostic.IDE0078.severity = warning
csharp_style_prefer_pattern_matching = true
# IDE0079: "Remove unnecessary suppression"
# PEARL: As of Visual Studio 17.12.0 this warning was being issued on many legitimate suppressions, so we had no
# option but to suppress it, but now they seem to have fixed it.
dotnet_diagnostic.IDE0079.severity = warning
# Values: comma-separated list of rule ids or categories to exclude, or 'all' to disable, or 'none' to apply everywhere.
dotnet_remove_unnecessary_suppression_exclusions = none
# IDE0080: "Remove unnecessary suppression operator"
# PEARL: The null-forgiving operator is also known as the damnit operator, and this rule unnecessarily introduces yet
# one more synonym for it, by calling it "suppression operator".
dotnet_diagnostic.IDE0080.severity = warning
# IDE0081: "Remove ByVal"
dotnet_diagnostic.IDE0081.severity = error
# Justification: This is a Visual Basic-only rule, and we do not care at all about Visual Basic.
# IDE0082: "Convert typeof to nameof"
# PEARL: Normally we would want to have this enabled; however we must not, due to a Roslyn / Visual Studio bug:
# If `nameof( <type> )` appears anywhere within a class, then IDE0051: "Remove unused private member" stops working
# for unused methods in that class.
# The workaround is to replace all instances of `nameof( <type> )` with `typeof( <type> ).Name`.
# Unfortunately, this workaround is not applicable in cases where the name of a type must be a compile-time constant,
# so there are some situations where we have to use `nameof( <type> )` and just live with the bug.
dotnet_diagnostic.IDE0082.severity = none
# IDE0083: "Use pattern matching (not operator)"
dotnet_diagnostic.IDE0083.severity = warning
csharp_style_prefer_not_pattern = true
# IDE0084: "Use pattern matching (IsNot operator)"
dotnet_diagnostic.IDE0084.severity = error
# Justification: This is a Visual Basic-only rule, and we do not care at all about Visual Basic.
# IDE0090: "Simplify `new` expression"
# a.k.a. "'new' expression can be simplified"
# a.k.a. "implicit object creation"
# a.k.a. "target-typed `new`"
# Also see IDE0008: "Use explicit type instead of 'var'"
dotnet_diagnostic.IDE0090.severity = silent
csharp_style_implicit_object_creation_when_type_is_apparent = true
# Justification:
# Target-typed new is kinda cool at first glance, but as it turns out, it is rather cumbersome to use, because while
# editing code we quite often move object construction from places where target-type-new is applicable to places where
# it is not applicable, and vice versa, and I do not want to have to go each time and add or remove the explicit
# constructor invocation. Thus, this rule better be avoided. We set it to 'silent' to be offered the refactoring.
# IDE0100: "Remove unnecessary equality operator" a.k.a. "Remove redundant equality"
# This rule is configured differently between production code and test code.
# IDE0110: "Remove unnecessary discard"
dotnet_diagnostic.IDE0110.severity = warning
# IDE0120: "Simplify LINQ expression"
dotnet_diagnostic.IDE0120.severity = silent
# Justification:
# - I assign no significance whatsoever to the performance overhead of one additional method in the chain.
# - I like functions that do only one thing, and by extension function _calls_ that do only one thing.
# - I want the presence or absence of `Where()` to signify, at a glance, the presence or absence of a filter.
# - I want the termination method call to be clutter-free, so I can easily see what the entire chain culminates in.
# IDE0130: "Namespace does not match folder structure"
# PEARL: If the severity of IDE0130 is 'warning', then `dotnet format style` will crash.
# This has been discussed here:
# > Github - dotnet/format - issue #1623
# > Unhandled exception in call to Workspace.TryApplyChanges
# > https://github.com/dotnet/format/issues/1623
# ...and nothing has been done about it for years.
dotnet_diagnostic.IDE0130.severity = warning
dotnet_style_namespace_match_folder = true
# IDE0140: "Simplify object creation"
dotnet_diagnostic.IDE0140.severity = error
# Justification: This is a Visual Basic-only rule, and we do not care at all about Visual Basic.
# IDE0150: "Prefer 'null' check over type check"
dotnet_diagnostic.IDE0150.severity = warning
csharp_style_prefer_null_check_over_type_check = true
# IDE0160: "Use block-scoped namespace"
# See also IDE0161: "Convert to file-scoped namespace"
# For options, see IDE0161
dotnet_diagnostic.IDE0160.severity = none
# IDE0161: "Convert to file-scoped namespace"
# See also IDE0160: "Use block-scoped namespace"
dotnet_diagnostic.IDE0161.severity = warning
# PEARL: This option controls both IDE0160 and IDE0161
# Possible values: `block_scoped`, `file_scoped`. Default = `block_scoped`.
csharp_style_namespace_declarations = file_scoped
# IDE0170: "Simplify property pattern"
dotnet_diagnostic.IDE0170.severity = warning
csharp_style_prefer_extended_property_pattern = true
# IDE0180: "Use tuple to swap values"
dotnet_diagnostic.IDE0180.severity = warning
csharp_style_prefer_tuple_swap = true
# IDE0200: "Remove unnecessary lambda expression" (Applicable languages: C# 11+)
dotnet_diagnostic.IDE0200.severity = warning
csharp_style_prefer_method_group_conversion = true
# IDE0210: "Convert to top-level statements"
# PEARL: Note the biased name of this rule
# Also see IDE0211: "Convert to 'Program.Main' style program"
# For options, see IDE0211
dotnet_diagnostic.IDE0210.severity = none
# Justification: Top-level code statements are for script kiddies. The use of `Main()` is fine.
# IDE0211: "Convert to 'Program.Main' style program"
# PEARL: Note the biased name of this rule
# Also see IDE0210: "Convert to top-level statements"
dotnet_diagnostic.IDE0211.severity = warning
# PEARL: this option controls both IDE0210 and IDE0211
csharp_style_prefer_top_level_statements = false
# Justification: Top-level code statements are for script kiddies. Use a proper `Main()` instead.
# IDE0220: "Add explicit cast in foreach loop"
dotnet_diagnostic.IDE0220.severity = warning
# Valid values: `always` and `when_strongly_typed`. Default is `when_strongly_typed`.
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
# IDE0230: "Use UTF-8 string literal"
dotnet_diagnostic.IDE0230.severity = warning
csharp_style_prefer_utf8_string_literals = true
# IDE0240: "Nullable directive is redundant"
dotnet_diagnostic.IDE0240.severity = warning
# IDE0241: "Nullable directive is unnecessary"
dotnet_diagnostic.IDE0241.severity = warning
# IDE0250: "Struct can be made 'readonly'"
dotnet_diagnostic.IDE0250.severity = warning
csharp_style_prefer_readonly_struct = true
# IDE0251: "Member can be made 'readonly'"
# PEARL: if IDE0251 is given a severity of 'warning', then `dotnet format` will insert `readonly` modifiers in various
# methods, and in doing so it will mess-up the modifier order specified elsewhere in editorconfig.
dotnet_diagnostic.IDE0251.severity = suggestion
csharp_style_prefer_readonly_struct_member = true
# IDE0260: "Use pattern matching"
# Also see IDE0019: "Use pattern matching to avoid 'as' followed by a 'null' check"
# Also see IDE0078: "Use pattern matching"
# For options, see IDE0019
# PEARL: This diagnostic has the same name as IDE0078: "Use pattern matching"
dotnet_diagnostic.IDE0260.severity = warning
# IDE0270: "Null check can be simplified (if null check)"
# See also IDE0029: "Null check can be simplified (ternary conditional check)"
# See also IDE0030: "Null check can be simplified (nullable ternary conditional check)"
# For options, see IDE0029
dotnet_diagnostic.IDE0270.severity = warning
# Justification: Sometimes we just want to handle the null case separately, so it better not be a warning, but it is
# useful to know that simplification is possible, and to have the refactoring available; hence, it is a suggestion.
# IDE0280: "Use 'nameof'"
dotnet_diagnostic.IDE0280.severity = warning
# IDE0290: "Use primary constructor"
dotnet_diagnostic.IDE0290.severity = silent
csharp_style_prefer_primary_constructors = true
# IDE0300: "Use collection expression for array" (C# 12+)
# PEARL: collection expressions create types that cannot be found with 'search for type'.
# PEARL: collection expressions create defective types that do not properly implement `Equals()` and `GetHashCode()`.
# PEARL: the rules can be used to enforce the use of collection expressions but cannot be used to prohibit the use of
# collection expressions.
dotnet_diagnostic.IDE0300.severity = error
# PEARL: `dotnet_style_prefer_collection_expression` somehow controls all of the following: IDE0300, IDE0301, IDE0302,
# IDE0303, IDE0304, and IDE0305.
# Possible values:
# - true | when_types_exactly_match -> Prefer collection expressions only when types match exactly, for example,
# int[] i = Array.Empty<int>();.
# - when_types_loosely_match -> (NET 9+) Prefer to use collection expressions even when types match loosely,
# for example, IEnumerable<int> i = Array.Empty<int>();. The targeted type must
# match the type on the right-hand side or be one of the following types:
# IEnumerable<T>, ICollection<T>, IList<T>, IReadOnlyCollection<T>,
# IReadOnlyList<T>.
# - false | never -> Disables the rule.
dotnet_style_prefer_collection_expression = never
# Justification: due to the PEARLs listed above, collection expressions are lame and should never be used.
# IDE0301: "Use collection expression for empty" (C# 12+)
# For options, see IDE0300
dotnet_diagnostic.IDE0301.severity = error
# IDE0302: "Use collection expression for stackalloc" (C# 12+)
# For options, see IDE0300
dotnet_diagnostic.IDE0302.severity = error
# IDE0303: "Use collection expression for Create()" (C# 12+)
# For options, see IDE0300
dotnet_diagnostic.IDE0303.severity = error
# IDE0304: "Use collection expression for builder" (C# 12+)
# For options, see IDE0300
dotnet_diagnostic.IDE0304.severity = error
# IDE0305: "Use collection expression for fluent" (C# 12+)
# For options, see IDE0300
dotnet_diagnostic.IDE0305.severity = error
# IDE1005: "Use conditional delegate call"
# PEARL: there seems to be no rule to detect superfluous use of conditional delegate call. (Use of a conditional
# delegate call on a non-nullable delegate.)
dotnet_diagnostic.IDE1005.severity = warning
csharp_style_conditional_delegate_call = true
# IDE1006: "Naming rule violation"
# PEARL: The severity specified here takes precedence over the severity specified in each individual naming rule!
# PEARL: When the severity of IDE1006 is `warning`, the command `dotnet format style` will issue the following message:
# "Unable to fix IDE1006. Code fix NamingStyleCodeFixProvider doesn't support Fix All in Solution."
dotnet_diagnostic.IDE1006.severity = warning
# General syntax for defining naming rules:
#
# dotnet_naming_style.<StyleName>.capitalization = one of: pascal_case, camel_case, first_word_upper, all_upper, all_lower
# dotnet_naming_style.<StyleName>.required_prefix = <string>
# dotnet_naming_style.<StyleName>.required_suffix = <string>
# dotnet_naming_style.<StyleName>.word_separator = <string>
#
# dotnet_naming_symbols.<SymbolsName>.applicable_kinds = one of: *, namespace, class, struct, interface, enum, property, method, field, event, delegate, parameter, type_parameter, local, local_function
# dotnet_naming_symbols.<SymbolsName>.applicable_accessibilities = one of: *, public, internal or friend, private, protected, protected_internal or protected_friend, private_protected, local
# dotnet_naming_symbols.<SymbolsName>.required_modifiers = one of: abstract or must_inherit, async, const, readonly, static or shared
#
# dotnet_naming_rule.<RuleName>.style = <StyleName>
# dotnet_naming_rule.<RuleName>.symbols = <SymbolsName>
# dotnet_naming_rule.<RuleName>.severity = one of: error, warning, suggestion, silent, none, default
#
# NOTE: You must specify a capitalization style as part of your naming style, otherwise your naming style might be ignored.
# define a naming style called 'pascal_case_style'
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_style.word_separator =
# define a naming style called 'camel_case_style'
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.word_separator =
# define a symbol group called 'private_symbols'
dotnet_naming_symbols.private_symbols.applicable_kinds = property, method, field, event
dotnet_naming_symbols.private_symbols.applicable_accessibilities = private
# define a symbol group called 'local_symbols'
dotnet_naming_symbols.local_symbols.applicable_kinds = parameter, local, local_function
dotnet_naming_symbols.local_symbols.applicable_accessibilities = *
# define a smybol_group called 'non_private_symbols'
dotnet_naming_symbols.non_private_symbols.applicable_kinds = property, method, field, event
dotnet_naming_symbols.non_private_symbols.applicable_accessibilities = public, protected, internal
# configure the 'private_symbols' group to use the 'camel_case_style' rule
# PEARL: if you set the severity of this one to error, it is still reported as a warning
dotnet_naming_rule.private_members_should_be_camel_case.severity = error
dotnet_naming_rule.private_members_should_be_camel_case.symbols = private_symbols
dotnet_naming_rule.private_members_should_be_camel_case.style = camel_case_style
# configure the 'local_symbols' group to use the 'camel_case_style' rule
# PEARL: if you set the severity of this one to error, then EVERYTHING is reported as an error.
dotnet_naming_rule.local_variables_should_be_camel_case.severity = warning
dotnet_naming_rule.local_variables_should_be_camel_case.symbols = local_symbols
dotnet_naming_rule.local_variables_should_be_camel_case.style = camel_case_style
# configure the 'non_private_symbols' group to use the 'pascal_case_style' rule
# PEARL: if you set the severity of this one to error, it is still reported as a warning.
dotnet_naming_rule.non_private_members_should_be_pascal_case.severity = error
dotnet_naming_rule.non_private_members_should_be_pascal_case.symbols = non_private_symbols
dotnet_naming_rule.non_private_members_should_be_pascal_case.style = pascal_case_style
# IDE1007: Undocumented
# According to rumors, this used to be produced on already-error scenarios, to help the IDE to trigger features such as
# 'generate type'. It has probably been removed by now.
dotnet_diagnostic.IDE1007.severity = warning
# IDE2000: "Allow multiple blank lines"
# PEARL: `dotnet format whitespace` will not fix this.
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2000.severity = warning
dotnet_style_allow_multiple_blank_lines_experimental = false
# IDE2001: "Allow embedded statements on same line"
# PEARL: The term "embedded statement" has an established meaning in the industry, and it refers to statements of one
# programming language appearing within the code of another language. This is not what this rule is about. When this
# rule speaks of an "embaded statement" it is referring to the statement controlled by a flow-control statement.
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2001.severity = warning
csharp_style_allow_embedded_statements_on_same_line_experimental = false
# Justification: the statement controlled by a flow-control statement should never be placed on the same line as the
# flow-control statement.
# IDE2002: "Allow blank lines between consecutive braces" / "Consecutive braces should not have a blank line between them"
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2002.severity = warning
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
# Justification: code should not be littered with superfluous blank lines.
# IDE2003: "Allow statement immediately after block"
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2003.severity = warning
dotnet_style_allow_statement_immediately_after_block_experimental = true
# Justification: a code block is like any other statement; there is no reason to require a blank line after it.
# PEARL: This stupid rule applies not only to code blocks, but also to function blocks. So, if we want a blank line to
# be entirely optional after a code block, then a blank line will also be optional after a method block, which is not
# what we want, but we just have to live with it.
# IDE2004: "Allow blank line after colon in constructor initializer"
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2004.severity = warning
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
# IDE2005: "Allow blank line after token in conditional expression"
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
dotnet_diagnostic.IDE2005.severity = warning
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
# IDE2006: "Allow blank line after token in arrow expression"
# PEARL: This has been 'experimental' since its introduction in Nov 2022.
# PEARL: Note that the word 'clause' is present in the editorconfig option but not in the title.
dotnet_diagnostic.IDE2006.severity = warning
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
# Justification: if the arrow expression is not written on the same line as the method signature, then the arrow should
# be as close as possible to the place where the opening curly brace would have appeared if this was a block-bodied
# method. This means that the arrow and the arrow expression must not be separated, so they must both go to the next
# line.
#######################################################################################################################
# Editorconfig options without corresponding dotnet diagnostics
# PEARL: yep, of course there were bound to be some of those, too.
# Valid values: end_of_line, beginning_of_line (the default)
dotnet_style_operator_placement_when_wrapping = beginning_of_line
#######################################################################################################################
# Dotnet diagnostics (CAxxxx)
# "API surface" for dotnet_code_quality
# Allowed values (separated by commas)
# - public (applies to public and protected APIs)
# - internal or friend (applies to internal and private protected APIs)
# - private (applies to private APIs)
# - all (applies to all APIs)
# The default is `public`; we want `all`, and we will set it to a stricter scope on a case-by-case basis.
# PEARL: in api_surface, the value 'public' actually means 'public or protected'.
dotnet_code_quality.api_surface = all
# CA1000: "Do not declare static members on generic types"
dotnet_diagnostic.CA1000.severity = none
# Justification: The justification given by the documentation for this rule is utterly unconvincing.
# Static members on generic types are fine.
# CA1001: "Types that own disposable fields should be disposable"
dotnet_diagnostic.CA1001.severity = warning
# CA1002: Do not expose generic lists
# a.k.a. Change 'List<{0}>' in '{1}' to use 'Collection<T>', 'ReadOnlyCollection<T>' or 'KeyedCollection<K,V>'.
# PEARL: The collections that this rule suggests as replacements for `List<>` are all retarded. The collections that
# would be suitable are `IList<T>` and `IReadOnlyList<T>`, but this rule is not suggesting them. Therefore, we
# have to disable this rule in order to prevent programmers from blindly following it and creating a mess.
dotnet_diagnostic.CA1002.severity = none
dotnet_code_quality.CA1002.api_surface = public
# CA1003: "Use generic event handler instances"
# PEARL: The word 'generic' here is not used in the sense of parametric polymorphism; it is used in the sense of "one
# type fits all", and the type that fits all is `EventArgs`.
dotnet_diagnostic.CA1003.severity = none
# Justification: This is absolutely retarded. Do _not_ use EventArgs; use custom event handlers instead.
# CA1004: Undocumented/Nonexistent
dotnet_diagnostic.CA1004.severity = error
# CA1005: "Avoid excessive parameters on generic types"
dotnet_diagnostic.CA1005.severity = none
# Justification: Our generic types will have as many parameters as we want them to.
# CA1006: Undocumented/Nonexistent
dotnet_diagnostic.CA1006.severity = error
# CA1007: Undocumented/Nonexistent
dotnet_diagnostic.CA1007.severity = error
# CA1008: "Enums should have zero value"
# PEARL: This stupid inspection does not only trigger on enums that do not have a zero value; it also triggers on
# enums that do have a zero value, but it is called something other than 'None'. Whoever decided that this should
# work this way is a complete retard.
dotnet_diagnostic.CA1008.severity = none
# Justification: Enums should have whatever values we choose.
# CA1009: Undocumented/Nonexistent
dotnet_diagnostic.CA1009.severity = error
# CA1010: "Collections should implement generic interface"
dotnet_diagnostic.CA1010.severity = warning
# CA1011: Undocumented/Nonexistent
dotnet_diagnostic.CA1011.severity = error
# CA1012: "Abstract types should not have constructors"
# PEARL: The text "Abstract types should not have constructors" is _wrong_.
# The correct text is: "Abstract types should not have _public_ constructors".
# It is absolutely perfectly fine for an abstract type to have a constructor, as long as it is protected, and it
# is also absolutely perfectly fine for an abstract type to have a private constructor, as long as it also has
# at least one protected constructor.
dotnet_diagnostic.CA1012.severity = warning
# CA1013: Undocumented/Nonexistent
dotnet_diagnostic.CA1013.severity = error
# CA1014: "Mark assemblies with CLSCompliant"
dotnet_diagnostic.CA1014.severity = none
# Justification: This warning aims to ensure that an assembly can be invoked from other CLR languages, like Visual
# Basic, but we do not care about other CLR languages, and we especially do not care about Visual Basic.
# CA1015: Undocumented/Nonexistent
dotnet_diagnostic.CA1015.severity = error
# CA1016: "Mark assemblies with assembly version"
dotnet_diagnostic.CA1016.severity = none
# Justification: #AintNoBodyGotNoTimeFoDat.
# CA1017: "Mark assemblies with ComVisible"
dotnet_diagnostic.CA1017.severity = warning
# Justification: We do not care at all about "COM".
# CA1018: "Mark attributes with AttributeUsageAttribute"
dotnet_diagnostic.CA1018.severity = warning
# CA1019: "Define accessors for attribute arguments"
dotnet_diagnostic.CA1019.severity = warning
# CA1020: Undocumented/Nonexistent
dotnet_diagnostic.CA1020.severity = error
# CA1021: "Avoid `out` parameters"
# PEARL: The message issued by this rule says "Avoid 'out' parameters as they are not designed for general audience".
# What they meant to say is: "Avoid 'out' parameters as it turns out that they were a bad idea afterall".
# See also CA1045: "Do not pass types by reference"
dotnet_diagnostic.CA1021.severity = warning
dotnet_code_quality.CA1021.api_surface = public
# CA1022: Undocumented/Nonexistent
dotnet_diagnostic.CA1022.severity = error
# CA1023: Undocumented/Nonexistent
dotnet_diagnostic.CA1023.severity = error
# CA1024: "Use properties where appropriate"
dotnet_diagnostic.CA1024.severity = suggestion
dotnet_code_quality.CA1024.api_surface = public
# CA1025: Undocumented/Nonexistent
dotnet_diagnostic.CA1025.severity = error
# CA1026: Undocumented/Nonexistent
dotnet_diagnostic.CA1026.severity = error
# CA1027: "Mark enums with FlagsAttribute"
dotnet_diagnostic.CA1027.severity = warning
# CA1028: "Enum Storage should be Int32"
dotnet_diagnostic.CA1028.severity = warning
dotnet_code_quality.CA1028.api_surface = public
# CA1029: Undocumented/Nonexistent
dotnet_diagnostic.CA1029.severity = error
# CA1030: "Use events where appropriate"
dotnet_diagnostic.CA1030.severity = none
# Justification: This rule is retarded. It triggers if you have a public method called AddOn, RemoveOn, Fire, or Raise.
# If I want to have a method called "Fire", or "Raise", I probably know what I am doing.
# CA1031: "Do not catch general exception types"
dotnet_diagnostic.CA1031.severity = none
# Justification: I know what I am doing, thank you.
# CA1032: "Implement standard exception constructors"
dotnet_diagnostic.CA1032.severity = none
# Justification: Standard exception constructors are ill-conceived. Each exception should have a very narrow purpose,
# and a very specific set of parameters to facilitate this purpose and nothing but this purpose.
# Standard exception constructors are meant to facilitate general-purpose use, and we specifically do not want this.
# CA1033: "Interface methods should be callable by child types"
dotnet_diagnostic.CA1033.severity = suggestion # TODO: promote to warning
# CA1034: "Nested types should not be visible"
# PEARL: The documentation justifies this by saying "Nested types include the notion of member accessibility,
# which some programmers do not understand clearly."
dotnet_diagnostic.CA1034.severity = none
# Justification: Programmers who do not clearly understand the notion of member accessibility should be milking goats
# instead of trying to program.
# CA1035: Undocumented/Nonexistent
dotnet_diagnostic.CA1035.severity = error
# CA1036: "Override methods on comparable types"
dotnet_diagnostic.CA1036.severity = none
# Justification: This rule is saying that if I invest the effort to make a class implement IComparable, that's not
# enough, I must then invest considerable additional effort to implement operators ==, !=, <, <=, >, and >=.
# What kind of idiot comes up with these rules? #AintNoBodyGotNoTimeFoDat