-
-
Notifications
You must be signed in to change notification settings - Fork 281
Expand file tree
/
Copy path.editorconfig
More file actions
1622 lines (1532 loc) · 128 KB
/
.editorconfig
File metadata and controls
1622 lines (1532 loc) · 128 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
# editorconfig.org
# top-most EditorConfig file
root = true
#############################################
# Default settings
#############################################
[*]
insert_final_newline = true
indent_style = space
indent_size = 4
[project.json]
indent_size = 2
#############################################
# C# Code Style Settings
#############################################
[*.cs]
###################
# New line preferences
###################
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
###################
# Indentation preferences
###################
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
###################
# Modifier preferences
###################
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion
###################
# 'this.' qualification
###################
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
###################
# 'var' preferences
###################
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
###################
# Predefined type preferences
###################
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
###################
# Naming conventions
###################
# Constant fields should be PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Static fields should have s_ prefix
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.capitalization = camel_case
# Internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
###################
# Code style defaults
###################
csharp_using_directive_placement = outside_namespace:suggestion
dotnet_sort_system_directives_first = true
csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true:none
csharp_preserve_single_line_statements = false:none
###################
# Code quality
###################
dotnet_code_quality_unused_parameters = non_public:suggestion
###################
# Expression-level preferences
###################
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###################
# Expression-bodied members
###################
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_lambdas = true:suggestion
csharp_style_expression_bodied_local_functions = true:suggestion
###################
# Other features
###################
csharp_style_prefer_index_operator = false:none
csharp_style_prefer_range_operator = false:none
csharp_style_pattern_local_over_anonymous_function = false:none
###################
# Space preferences
###################
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
#############################################
# Code Analyzers
#############################################
###################
# Custom Analyzers
###################
dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion
###################
# Microsoft .NET Analyzers (CA) - Design Rules
###################
dotnet_diagnostic.CA1000.severity = none # Do not declare static members on generic types — common factory pattern
dotnet_diagnostic.CA1001.severity = error # Types that own disposable fields should be disposable
dotnet_diagnostic.CA1002.severity = none # Do not expose generic lists — we deliberately expose List<T>; interface-based collections are an older convention we don't follow
dotnet_diagnostic.CA1003.severity = error # Use generic event handler instances
dotnet_diagnostic.CA1005.severity = error # Avoid excessive parameters on generic types
dotnet_diagnostic.CA1008.severity = error # Enums should have zero value
dotnet_diagnostic.CA1010.severity = none # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow
dotnet_diagnostic.CA1012.severity = error # Abstract types should not have public constructors
dotnet_diagnostic.CA1014.severity = none # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies
dotnet_diagnostic.CA1016.severity = error # Mark assemblies with AssemblyVersionAttribute
dotnet_diagnostic.CA1017.severity = none # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies
dotnet_diagnostic.CA1018.severity = error # Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1019.severity = error # Define accessors for attribute arguments
dotnet_diagnostic.CA1021.severity = error # Avoid out parameters
dotnet_diagnostic.CA1024.severity = error # Use properties where appropriate
dotnet_diagnostic.CA1027.severity = error # Mark enums with FlagsAttribute
dotnet_diagnostic.CA1028.severity = error # Enum storage should be Int32
dotnet_diagnostic.CA1030.severity = none # Use events where appropriate — we use Rx observables instead of CLR events
dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types — required at logging/dispose/IO boundaries
dotnet_diagnostic.CA1032.severity = error # Implement standard exception constructors
dotnet_diagnostic.CA1033.severity = none # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice
dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers)
dotnet_diagnostic.CA1036.severity = none # Override methods on comparable types — relational operators rarely meaningful for our types
dotnet_diagnostic.CA1040.severity = error # Avoid empty interfaces
dotnet_diagnostic.CA1041.severity = error # Provide ObsoleteAttribute message
dotnet_diagnostic.CA1043.severity = error # Use integral or string argument for indexers
dotnet_diagnostic.CA1044.severity = error # Properties should not be write only
dotnet_diagnostic.CA1045.severity = error # Do not pass types by reference
dotnet_diagnostic.CA1046.severity = error # Do not overload operator equals on reference types
dotnet_diagnostic.CA1047.severity = error # Do not declare protected member in sealed type
dotnet_diagnostic.CA1048.severity = error # Do not declare virtual members in sealed types
dotnet_diagnostic.CA1050.severity = error # Declare types in namespaces
dotnet_diagnostic.CA1051.severity = error # Do not declare visible instance fields
dotnet_diagnostic.CA1052.severity = error # Static holder types should be sealed
dotnet_diagnostic.CA1053.severity = error # Static holder types should not have constructors
dotnet_diagnostic.CA1054.severity = suggestion # URI parameters should not be strings
dotnet_diagnostic.CA1055.severity = suggestion # URI return values should not be strings
dotnet_diagnostic.CA1056.severity = suggestion # URI properties should not be strings
dotnet_diagnostic.CA1058.severity = error # Types should not extend certain base types
dotnet_diagnostic.CA1059.severity = error # Members should not expose certain concrete types
dotnet_diagnostic.CA1060.severity = error # Move P/Invokes to NativeMethods class
dotnet_diagnostic.CA1061.severity = error # Do not hide base class methods
dotnet_diagnostic.CA1062.severity = error # Validate arguments of public methods
dotnet_code_quality.CA1062.null_check_validation_methods = ThrowIfNull|ThrowIfNullOrEmpty|ThrowIfNullOrWhiteSpace|ThrowIfNullWithMessage
dotnet_diagnostic.CA1063.severity = error # Implement IDisposable correctly
dotnet_diagnostic.CA1064.severity = error # Exceptions should be public
dotnet_diagnostic.CA1065.severity = error # Do not raise exceptions in unexpected locations
dotnet_diagnostic.CA1066.severity = error # Implement IEquatable when overriding Equals
dotnet_diagnostic.CA1067.severity = error # Override Equals when implementing IEquatable
dotnet_diagnostic.CA1068.severity = error # CancellationToken parameters must come last
dotnet_diagnostic.CA1069.severity = error # Enums should not have duplicate values
dotnet_diagnostic.CA1070.severity = error # Do not declare event fields as virtual
###################
# Microsoft .NET Analyzers (CA) - Globalization Rules
###################
dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters — we don't ship localized resources
dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization
###################
# Microsoft .NET Analyzers (CA) - Interoperability Rules
###################
dotnet_diagnostic.CA1401.severity = error # P/Invokes should not be visible
###################
# Microsoft .NET Analyzers (CA) - Maintainability Rules
###################
dotnet_diagnostic.CA1500.severity = error # Variable names should not match field names
dotnet_diagnostic.CA1501.severity = none # Avoid excessive inheritance — disabled because the analyzer noticeably slows down the build
dotnet_diagnostic.CA1502.severity = none # Avoid excessive complexity — disabled because the analyzer noticeably slows down the build
dotnet_diagnostic.CA1505.severity = error # Avoid unmaintainable code
dotnet_diagnostic.CA1506.severity = none # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code
dotnet_diagnostic.CA1507.severity = error # Use nameof in place of string
dotnet_diagnostic.CA1508.severity = error # Avoid dead conditional code
dotnet_diagnostic.CA1509.severity = error # Invalid entry in code metrics configuration file
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity
dotnet_diagnostic.CA1511.severity = none # Use ArgumentException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity
dotnet_diagnostic.CA1512.severity = none # Use ArgumentOutOfRangeException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity
dotnet_diagnostic.CA1513.severity = none # Use ObjectDisposedException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
dotnet_diagnostic.CA1515.severity = none # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.)
dotnet_diagnostic.CA1516.severity = error # Use cross-platform intrinsics
###################
# Microsoft .NET Analyzers (CA) - Naming Rules
###################
dotnet_diagnostic.CA1710.severity = suggestion # Identifiers should have correct suffix
dotnet_diagnostic.CA1724.severity = none # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface
###################
# Microsoft .NET Analyzers (CA) - Performance Rules
###################
dotnet_diagnostic.CA1802.severity = error # Use literals where appropriate
dotnet_diagnostic.CA1805.severity = error # Do not initialize unnecessarily
dotnet_diagnostic.CA1806.severity = error # Do not ignore method results
dotnet_diagnostic.CA1810.severity = none # Initialize reference type static fields inline — explicit static constructors are deliberate in some types
dotnet_diagnostic.CA1812.severity = error # Avoid uninstantiated internal classes
dotnet_diagnostic.CA1813.severity = error # Avoid unsealed attributes
dotnet_diagnostic.CA1814.severity = error # Prefer jagged arrays over multidimensional
dotnet_diagnostic.CA1815.severity = error # Override equals and operator equals on value types
dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase
dotnet_diagnostic.CA1820.severity = error # Test for empty strings using string length
dotnet_diagnostic.CA1821.severity = error # Remove empty finalizers
dotnet_diagnostic.CA1822.severity = error # Mark members as static
dotnet_diagnostic.CA1823.severity = error # Avoid unused private fields
dotnet_diagnostic.CA1824.severity = error # Mark assemblies with NeutralResourcesLanguageAttribute
dotnet_diagnostic.CA1825.severity = error # Avoid zero-length array allocations
dotnet_diagnostic.CA1826.severity = error # Use property instead of Linq Enumerable method
dotnet_diagnostic.CA1827.severity = error # Do not use Count/LongCount when Any can be used
dotnet_diagnostic.CA1828.severity = error # Do not use CountAsync/LongCountAsync when AnyAsync can be used
dotnet_diagnostic.CA1829.severity = error # Use Length/Count property instead of Enumerable.Count method
dotnet_diagnostic.CA1830.severity = error # Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1831.severity = error # Use AsSpan instead of Range-based indexers for string when appropriate
dotnet_diagnostic.CA1832.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array
dotnet_diagnostic.CA1833.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array
dotnet_diagnostic.CA1834.severity = error # Use StringBuilder.Append(char) for single character strings
dotnet_diagnostic.CA1835.severity = error # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes
dotnet_diagnostic.CA1836.severity = error # Prefer IsEmpty over Count when available
dotnet_diagnostic.CA1837.severity = error # Use Environment.ProcessId instead of Process.GetCurrentProcess().Id
dotnet_diagnostic.CA1838.severity = error # Avoid StringBuilder parameters for P/Invokes
dotnet_diagnostic.CA1839.severity = error # Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName
dotnet_diagnostic.CA1840.severity = error # Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId
dotnet_diagnostic.CA1841.severity = error # Prefer Dictionary.Contains methods
dotnet_diagnostic.CA1842.severity = error # Do not use 'WhenAll' with a single task
dotnet_diagnostic.CA1843.severity = error # Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1844.severity = error # Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1845.severity = error # Use span-based 'string.Concat'
dotnet_diagnostic.CA1846.severity = error # Prefer AsSpan over Substring
dotnet_diagnostic.CA1847.severity = none # Use char literal for a single character lookup — disabled because the string.Contains(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both
dotnet_diagnostic.CA1848.severity = error # Use the LoggerMessage delegates
dotnet_diagnostic.CA1849.severity = error # Call async methods when in an async method
dotnet_diagnostic.CA1850.severity = error # Prefer static HashData method over ComputeHash
dotnet_diagnostic.CA1851.severity = error # Possible multiple enumerations of IEnumerable collection
dotnet_diagnostic.CA1852.severity = error # Seal internal types
dotnet_code_quality.CA1852.api_surface = private, internal # only flag non-public classes; public classes stay open for inheritance
dotnet_diagnostic.CA1853.severity = error # Unnecessary call to 'Dictionary.ContainsKey(key)'
dotnet_diagnostic.CA1854.severity = error # Prefer the IDictionary.TryGetValue(TKey, out TValue) method
dotnet_diagnostic.CA1855.severity = error # Prefer 'Clear' over 'Fill'
dotnet_diagnostic.CA1856.severity = error # Incorrect usage of ConstantExpected attribute
dotnet_diagnostic.CA1857.severity = error # A constant is expected for the parameter
dotnet_diagnostic.CA1858.severity = error # Use 'StartsWith' instead of 'IndexOf'
dotnet_diagnostic.CA1859.severity = error # Use concrete types when possible for improved performance
dotnet_diagnostic.CA1860.severity = error # Avoid using 'Enumerable.Any()' extension method
dotnet_diagnostic.CA1861.severity = error # Avoid constant arrays as arguments
dotnet_diagnostic.CA1862.severity = error # Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
dotnet_diagnostic.CA1863.severity = error # Use 'CompositeFormat'
dotnet_diagnostic.CA1864.severity = error # Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
dotnet_diagnostic.CA1865.severity = none # Use char overload (string.StartsWith) — disabled because the string.StartsWith(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both
dotnet_diagnostic.CA1866.severity = none # Use char overload (string.EndsWith) — disabled because the string.EndsWith(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both
dotnet_diagnostic.CA1867.severity = none # Use char overload (string.IndexOf / string.LastIndexOf) — disabled because the char overloads don't exist on .NET Framework / netstandard2.0 and we target both
dotnet_diagnostic.CA1868.severity = error # Unnecessary call to 'Contains' for sets
dotnet_diagnostic.CA1869.severity = error # Cache and reuse 'JsonSerializerOptions' instances
dotnet_diagnostic.CA1870.severity = error # Use a cached 'SearchValues' instance
dotnet_diagnostic.CA1871.severity = error # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'
dotnet_diagnostic.CA1872.severity = error # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
dotnet_diagnostic.CA1873.severity = error # Avoid potentially expensive evaluation of arguments to 'Debug.Assert'
dotnet_diagnostic.CA1874.severity = error # Use 'Regex.IsMatch'
dotnet_diagnostic.CA1875.severity = error # Use 'Regex.Count'
dotnet_diagnostic.CA1877.severity = error # Use 'Encoding.GetString' instead of 'Encoding.GetChars'
###################
# Microsoft .NET Analyzers (CA) - Reliability Rules
###################
dotnet_diagnostic.CA2000.severity = suggestion # Dispose objects before losing scope
dotnet_diagnostic.CA2002.severity = error # Do not lock on objects with weak identity
dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task — Rx and library callers drive synchronization context themselves
dotnet_diagnostic.CA2008.severity = error # Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2009.severity = error # Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2011.severity = error # Do not assign property within its setter
dotnet_diagnostic.CA2012.severity = error # Use ValueTasks correctly
dotnet_diagnostic.CA2013.severity = error # Do not use ReferenceEquals with value types
dotnet_diagnostic.CA2014.severity = error # Do not use stackalloc in loops
dotnet_diagnostic.CA2015.severity = error # Do not define finalizers for types derived from MemoryManager<T>
dotnet_diagnostic.CA2016.severity = error # Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch
dotnet_diagnostic.CA2018.severity = error # The 'count' argument to 'Buffer.BlockCopy' should specify the number of bytes to copy
dotnet_diagnostic.CA2019.severity = error # Improper 'ThreadStatic' field initialization
dotnet_diagnostic.CA2020.severity = error # Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr
dotnet_diagnostic.CA2021.severity = error # Don't call Enumerable.Cast<T> or Enumerable.OfType<T> with incompatible types
dotnet_diagnostic.CA2022.severity = error # Avoid inexact read with 'Stream.Read'
dotnet_diagnostic.CA2023.severity = error # Invalid braces in message template
dotnet_diagnostic.CA2024.severity = error # Do not use 'StreamReader.EndOfStream' in async methods
dotnet_diagnostic.CA2025.severity = error # Do not pass 'IDisposable' instances into unawaited tasks
dotnet_diagnostic.CA2026.severity = error # Do not use methods or types annotated with [RequiresDynamicCode] in code that uses [RequiresDynamicCode]
###################
# Microsoft .NET Analyzers (CA) - Usage Rules
###################
dotnet_diagnostic.CA1801.severity = error # Review unused parameters
dotnet_code_quality.CA1801.api_surface = private, internal # only flag non-public APIs so we don't break public signatures
dotnet_diagnostic.CA1816.severity = error # Call GC.SuppressFinalize correctly
dotnet_diagnostic.CA2200.severity = error # Rethrow to preserve stack details
dotnet_diagnostic.CA2201.severity = error # Do not raise reserved exception types
dotnet_diagnostic.CA2207.severity = error # Initialize value type static fields inline
dotnet_diagnostic.CA2208.severity = none # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns
dotnet_diagnostic.CA2211.severity = error # Non-constant fields should not be visible
dotnet_diagnostic.CA2213.severity = error # Disposable fields should be disposed
dotnet_diagnostic.CA2214.severity = error # Do not call overridable methods in constructors
dotnet_diagnostic.CA2215.severity = error # Dispose methods should call base class dispose
dotnet_diagnostic.CA2216.severity = error # Disposable types should declare finalizer
dotnet_diagnostic.CA2217.severity = error # Do not mark enums with FlagsAttribute
dotnet_diagnostic.CA2218.severity = error # Override GetHashCode on overriding Equals
dotnet_diagnostic.CA2219.severity = error # Do not raise exceptions in finally clauses
dotnet_diagnostic.CA2224.severity = error # Override Equals on overloading operator equals
dotnet_diagnostic.CA2225.severity = error # Operator overloads have named alternates
dotnet_diagnostic.CA2226.severity = error # Operators should have symmetrical overloads
dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only — settable collection properties are common in our DTOs and config types
dotnet_diagnostic.CA2231.severity = error # Overload operator equals on overriding ValueType.Equals
dotnet_diagnostic.CA2234.severity = error # Pass System.Uri objects instead of strings
dotnet_diagnostic.CA2241.severity = error # Provide correct arguments to formatting methods
dotnet_diagnostic.CA2242.severity = error # Test for NaN correctly
dotnet_diagnostic.CA2243.severity = error # Attribute string literals should parse correctly
dotnet_diagnostic.CA2244.severity = error # Do not duplicate indexed element initializations
dotnet_diagnostic.CA2245.severity = error # Do not assign a property to itself
dotnet_diagnostic.CA2246.severity = error # Do not assign a symbol and its member in the same statement
dotnet_diagnostic.CA2247.severity = error # Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum
dotnet_diagnostic.CA2248.severity = error # Provide correct enum argument to Enum.HasFlag
dotnet_diagnostic.CA2249.severity = error # Use String.Contains instead of String.IndexOf for substring checks
dotnet_diagnostic.CA2250.severity = error # Use ThrowIfCancellationRequested
dotnet_diagnostic.CA2251.severity = error # Use String.Equals over String.Compare
dotnet_diagnostic.CA2252.severity = error # Opt in to preview features before using them
dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values
dotnet_diagnostic.CA2254.severity = error # Template should be a static expression
dotnet_diagnostic.CA2255.severity = error # The 'ModuleInitializer' attribute should not be used in libraries
dotnet_diagnostic.CA2256.severity = error # All members declared in parent interfaces must have an implementation in a 'DynamicInterfaceCastableImplementation' interface
dotnet_diagnostic.CA2257.severity = error # Members defined in a type with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'
dotnet_diagnostic.CA2258.severity = error # Providing a 'DynamicInterfaceCastableImplementation' interface in Visual Basic is unsupported
dotnet_diagnostic.CA2259.severity = error # 'ThreadStatic' only affects static fields
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
dotnet_diagnostic.CA2261.severity = error # Do not use 'ConfigureAwaitOptions.SuppressThrowing' with 'Task<TResult>'
dotnet_diagnostic.CA2262.severity = error # Set 'MaxResponseHeadersLength' properly
dotnet_diagnostic.CA2263.severity = error # Prefer generic overload when type is known
dotnet_diagnostic.CA2264.severity = error # Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
dotnet_diagnostic.CA2265.severity = error # Do not compare Span<T> to 'null' or 'default'
dotnet_diagnostic.CA2266.severity = error # Do not consume the result of 'Span<T>.Enumerator.MoveNext()' more than once
dotnet_diagnostic.CA2267.severity = error # Member should not be marked with 'StaticAttribute'
dotnet_diagnostic.CA2268.severity = error # Use 'string.Equals(string, string, StringComparison)' instead of the implicit ordinal overload
# Skipped (deprecated ISerializable formatter): CA2229 Implement serialization constructors,
# CA2235 Mark all non-serializable fields, CA2237 Mark ISerializable types with SerializableAttribute.
###################
# Microsoft .NET Analyzers (CA) - Security Rules
###################
# SQL Injection & Command Injection
dotnet_diagnostic.CA2100.severity = error # Review SQL queries for security vulnerabilities
dotnet_diagnostic.CA3001.severity = error # Review code for SQL injection vulnerabilities
dotnet_diagnostic.CA3006.severity = error # Review code for process command injection vulnerabilities
# Cross-Site Scripting (XSS) & Injection Attacks
dotnet_diagnostic.CA3002.severity = error # Review code for XSS vulnerabilities
dotnet_diagnostic.CA3003.severity = error # Review code for file path injection vulnerabilities
dotnet_diagnostic.CA3005.severity = error # Review code for LDAP injection vulnerabilities
dotnet_diagnostic.CA3007.severity = error # Review code for open redirect vulnerabilities
dotnet_diagnostic.CA3008.severity = error # Review code for XPath injection vulnerabilities
dotnet_diagnostic.CA3009.severity = error # Review code for XML injection vulnerabilities
dotnet_diagnostic.CA3010.severity = error # Review code for XAML injection vulnerabilities
dotnet_diagnostic.CA3011.severity = error # Review code for DLL injection vulnerabilities
dotnet_diagnostic.CA3012.severity = error # Review code for regex injection vulnerabilities
dotnet_diagnostic.CA3004.severity = error # Review code for information disclosure vulnerabilities
# Insecure Deserialization
dotnet_diagnostic.CA2300.severity = error # Do not use insecure deserializer BinaryFormatter
dotnet_diagnostic.CA2301.severity = error # Do not call BinaryFormatter.Deserialize without setting Binder
dotnet_diagnostic.CA2302.severity = error # Ensure BinaryFormatter.Binder is set before deserializing
dotnet_diagnostic.CA2305.severity = error # Do not use insecure deserializer LosFormatter
dotnet_diagnostic.CA2310.severity = error # Do not use insecure deserializer NetDataContractSerializer
dotnet_diagnostic.CA2311.severity = error # Do not deserialize without setting NetDataContractSerializer.Binder
dotnet_diagnostic.CA2312.severity = error # Ensure NetDataContractSerializer.Binder is set before deserializing
dotnet_diagnostic.CA2315.severity = error # Do not use insecure deserializer ObjectStateFormatter
dotnet_diagnostic.CA2321.severity = error # Do not deserialize with JavaScriptSerializer using SimpleTypeResolver
dotnet_diagnostic.CA2322.severity = error # Ensure JavaScriptSerializer not initialized with SimpleTypeResolver
dotnet_diagnostic.CA2326.severity = error # Do not use TypeNameHandling values other than None
dotnet_diagnostic.CA2327.severity = error # Do not use insecure JsonSerializerSettings
dotnet_diagnostic.CA2328.severity = error # Ensure that JsonSerializerSettings are secure
dotnet_diagnostic.CA2329.severity = error # Do not deserialize with JsonSerializer using insecure configuration
dotnet_diagnostic.CA2330.severity = error # Ensure JsonSerializer has secure configuration when deserializing
dotnet_diagnostic.CA2350.severity = error # Ensure DataTable.ReadXml()'s input is trusted
dotnet_diagnostic.CA2351.severity = error # Ensure DataSet.ReadXml()'s input is trusted
dotnet_diagnostic.CA2352.severity = error # Unsafe DataSet/DataTable in serializable type vulnerable to RCE
dotnet_diagnostic.CA2353.severity = error # Unsafe DataSet or DataTable in serializable type
dotnet_diagnostic.CA2354.severity = error # Unsafe DataSet/DataTable in deserialized object graph vulnerable to RCE
dotnet_diagnostic.CA2355.severity = error # Unsafe DataSet or DataTable in deserialized object graph
dotnet_diagnostic.CA2356.severity = error # Unsafe DataSet/DataTable in web deserialized object graph
dotnet_diagnostic.CA2361.severity = error # Ensure autogenerated class with DataSet.ReadXml() not used with untrusted data
dotnet_diagnostic.CA2362.severity = error # Unsafe DataSet/DataTable in autogenerated serializable type vulnerable to RCE
dotnet_diagnostic.CA5360.severity = error # Do not call dangerous methods in deserialization
dotnet_diagnostic.CA5362.severity = error # Potential reference cycle in deserialized object graph
# Cryptography - Weak & Broken Algorithms
dotnet_diagnostic.CA5350.severity = error # Do not use weak cryptographic algorithms (SHA1, RIPEMD160, TripleDES)
dotnet_diagnostic.CA5351.severity = error # Do not use broken cryptographic algorithms (MD5, DES, RC2)
dotnet_diagnostic.CA5358.severity = error # Do not use unsafe cipher modes (ECB, OFB, CFB)
dotnet_diagnostic.CA5373.severity = error # Do not use obsolete key derivation function
dotnet_diagnostic.CA5379.severity = error # Ensure key derivation function algorithm is sufficiently strong
dotnet_diagnostic.CA5384.severity = error # Do not use Digital Signature Algorithm (DSA)
dotnet_diagnostic.CA5385.severity = error # Use RSA algorithm with sufficient key size (>= 2048 bits)
dotnet_diagnostic.CA5387.severity = error # Do not use weak key derivation function with insufficient iteration count
dotnet_diagnostic.CA5388.severity = error # Ensure sufficient iteration count when using weak key derivation function
dotnet_diagnostic.CA5390.severity = error # Do not hard-code encryption key
dotnet_diagnostic.CA5394.severity = error # Do not use insecure randomness (use RNGCryptoServiceProvider)
dotnet_diagnostic.CA5401.severity = error # Do not use CreateEncryptor with non-default IV
dotnet_diagnostic.CA5402.severity = error # Use CreateEncryptor with the default IV
dotnet_diagnostic.CA5403.severity = error # Do not hard-code certificate
# TLS/SSL Protocol Security
dotnet_diagnostic.CA5359.severity = error # Do not disable certificate validation
dotnet_diagnostic.CA5361.severity = error # Do not disable SChannel use of strong crypto
dotnet_diagnostic.CA5364.severity = error # Do not use deprecated security protocols (TLS 1.0, TLS 1.1, SSL3)
dotnet_diagnostic.CA5378.severity = error # Do not disable ServicePointManagerSecurityProtocols
dotnet_diagnostic.CA5380.severity = error # Do not add certificates to root store
dotnet_diagnostic.CA5381.severity = error # Ensure certificates are not added to root store
dotnet_diagnostic.CA5386.severity = error # Avoid hardcoding SecurityProtocolType value
dotnet_diagnostic.CA5397.severity = error # Do not use deprecated SslProtocols values
dotnet_diagnostic.CA5398.severity = error # Avoid hardcoded SslProtocols values
dotnet_diagnostic.CA5399.severity = error # Definitely disable HttpClient certificate revocation list check
dotnet_diagnostic.CA5400.severity = error # Ensure HttpClient certificate revocation list check is not disabled
# Azure Storage / Shared Access Signature
dotnet_diagnostic.CA5375.severity = error # Do not use account shared access signature
dotnet_diagnostic.CA5376.severity = error # Use SharedAccessProtocol HttpsOnly
dotnet_diagnostic.CA5377.severity = error # Use container level access policy
# XML Security
dotnet_diagnostic.CA3061.severity = error # Do not add schema by URL
dotnet_diagnostic.CA3075.severity = error # Insecure DTD processing
dotnet_diagnostic.CA3076.severity = error # Insecure XSLT script execution
dotnet_diagnostic.CA3077.severity = error # Insecure processing in API design, XML Document and XML Text Reader
dotnet_diagnostic.CA5366.severity = error # Use XmlReader for DataSet read XML
dotnet_diagnostic.CA5369.severity = error # Use XmlReader for deserialize
dotnet_diagnostic.CA5370.severity = error # Use XmlReader for validating reader
dotnet_diagnostic.CA5371.severity = error # Use XmlReader for schema read
dotnet_diagnostic.CA5372.severity = error # Use XmlReader for XPathDocument
dotnet_diagnostic.CA5374.severity = error # Do not use XslTransform
# Web Security
dotnet_diagnostic.CA3147.severity = error # Mark verb handlers with ValidateAntiForgeryToken
dotnet_diagnostic.CA5363.severity = error # Do not disable request validation
dotnet_diagnostic.CA5365.severity = error # Do not disable HTTP header checking
dotnet_diagnostic.CA5368.severity = error # Set ViewStateUserKey for classes derived from Page
dotnet_diagnostic.CA5382.severity = error # Use secure cookies in ASP.NET Core
dotnet_diagnostic.CA5383.severity = error # Ensure use of secure cookies in ASP.NET Core
dotnet_diagnostic.CA5391.severity = error # Use antiforgery tokens in ASP.NET Core MVC controllers
dotnet_diagnostic.CA5395.severity = error # Miss HttpVerb attribute for action methods
dotnet_diagnostic.CA5396.severity = error # Set HttpOnly to true for HttpCookie
# P/Invoke & DLL Security
dotnet_diagnostic.CA2101.severity = error # Specify marshalling for P/Invoke string arguments
dotnet_diagnostic.CA5392.severity = error # Use DefaultDllImportSearchPaths attribute for P/Invokes
dotnet_diagnostic.CA5393.severity = error # Do not use unsafe DllImportSearchPath value
# Archive & File Security
dotnet_diagnostic.CA5389.severity = error # Do not add archive item's path to target file system path (Zip Slip)
# Token Validation & Authentication
dotnet_diagnostic.CA5404.severity = error # Do not disable token validation checks
dotnet_diagnostic.CA5405.severity = error # Do not always skip token validation in delegates
# Other Security Rules
dotnet_diagnostic.CA2109.severity = error # Review visible event handlers
dotnet_diagnostic.CA2119.severity = error # Seal methods that satisfy private interfaces
dotnet_diagnostic.CA2153.severity = error # Do not catch corrupted state exceptions
dotnet_diagnostic.CA5367.severity = error # Do not serialize types with pointer fields
###################
# Microsoft .NET Runtime Obsoletions (SYSLIB0xxx)
###################
dotnet_diagnostic.SYSLIB0001.severity = error # The UTF-7 encoding is insecure and should not be used
dotnet_diagnostic.SYSLIB0002.severity = error # PrincipalPermissionAttribute is not honored by the runtime and must not be used
dotnet_diagnostic.SYSLIB0003.severity = error # Code Access Security (CAS) is not supported or honored by the runtime
dotnet_diagnostic.SYSLIB0004.severity = error # Constrained Execution Region (CER) feature is not supported
dotnet_diagnostic.SYSLIB0005.severity = error # Global Assembly Cache is not supported
dotnet_diagnostic.SYSLIB0006.severity = error # Thread.Abort is not supported and throws PlatformNotSupportedException
dotnet_diagnostic.SYSLIB0007.severity = error # The default implementation of this cryptography algorithm is not supported
dotnet_diagnostic.SYSLIB0008.severity = error # The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException
dotnet_diagnostic.SYSLIB0009.severity = error # The AuthenticationManager Authenticate and PreAuthenticate methods are not supported
dotnet_diagnostic.SYSLIB0010.severity = error # This Remoting API is not supported and throws PlatformNotSupportedException
dotnet_diagnostic.SYSLIB0011.severity = error # BinaryFormatter serialization is obsolete
dotnet_diagnostic.SYSLIB0012.severity = error # Assembly.CodeBase and Assembly.EscapedCodeBase are obsolete
dotnet_diagnostic.SYSLIB0013.severity = error # Uri.EscapeUriString can corrupt the Uri string
dotnet_diagnostic.SYSLIB0014.severity = error # WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete — use HttpClient
dotnet_diagnostic.SYSLIB0015.severity = error # DisablePrivateReflectionAttribute is not honored
dotnet_diagnostic.SYSLIB0016.severity = error # Use Marshal.GetExceptionPointers instead
dotnet_diagnostic.SYSLIB0017.severity = error # Strong name signing is not supported on .NET Core
dotnet_diagnostic.SYSLIB0018.severity = error # ReflectionOnly loading is not supported
dotnet_diagnostic.SYSLIB0019.severity = error # RuntimeEnvironment members SystemConfigurationFile, GetSystemVersion, and FromGlobalAccessCache are not supported
dotnet_diagnostic.SYSLIB0020.severity = error # JsonSerializerOptions.IgnoreNullValues is obsolete — use DefaultIgnoreCondition
dotnet_diagnostic.SYSLIB0021.severity = error # Derived cryptographic types are obsolete — use the Create factory methods
dotnet_diagnostic.SYSLIB0022.severity = error # Rijndael types are obsolete — use Aes
dotnet_diagnostic.SYSLIB0023.severity = error # RNGCryptoServiceProvider is obsolete — use RandomNumberGenerator
dotnet_diagnostic.SYSLIB0024.severity = error # Creating and unloading AppDomains is not supported and throws an exception
dotnet_diagnostic.SYSLIB0025.severity = error # SuppressIldasmAttribute has no effect in .NET 6.0+
dotnet_diagnostic.SYSLIB0026.severity = error # X509Certificate and X509Certificate2 parameterless constructors are obsolete
dotnet_diagnostic.SYSLIB0027.severity = error # PublicKey.Key is obsolete — use the appropriate method to get the public key
dotnet_diagnostic.SYSLIB0028.severity = error # X509Certificate2.PrivateKey is obsolete — use the appropriate method to get the private key
dotnet_diagnostic.SYSLIB0029.severity = error # ProduceLegacyHmacValues is obsolete
dotnet_diagnostic.SYSLIB0030.severity = error # HMACSHA1 always uses the algorithm implementation provided by the platform
dotnet_diagnostic.SYSLIB0031.severity = error # EncodingProvider.GetEncoding(int, EncoderFallback, DecoderFallback) is obsolete
dotnet_diagnostic.SYSLIB0032.severity = error # Recovery from corrupted process state exceptions is not supported
dotnet_diagnostic.SYSLIB0033.severity = error # Rfc2898DeriveBytes.CryptDeriveKey is obsolete
dotnet_diagnostic.SYSLIB0034.severity = error # CmsSigner has been deprecated — use a constructor that accepts a SubjectIdentifierType
dotnet_diagnostic.SYSLIB0035.severity = error # ComputeCounterSignature without specifying a CmsSigner is obsolete
dotnet_diagnostic.SYSLIB0036.severity = error # Regex.CompileToAssembly is obsolete and not supported — use the RegexGenerator source generator
dotnet_diagnostic.SYSLIB0037.severity = error # AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete
dotnet_diagnostic.SYSLIB0038.severity = error # SerializationFormat.Binary is obsolete
dotnet_diagnostic.SYSLIB0039.severity = error # TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended
dotnet_diagnostic.SYSLIB0040.severity = error # EncryptionPolicy.NoEncryption and AllowEncryption significantly reduce security
dotnet_diagnostic.SYSLIB0041.severity = error # The default iteration count for Rfc2898DeriveBytes parameters is outdated and insecure
dotnet_diagnostic.SYSLIB0042.severity = error # ToXmlString and FromXmlString have no implementation for ECC types
dotnet_diagnostic.SYSLIB0043.severity = error # ECDiffieHellmanPublicKey.ToByteArray() and the associated constructor do not have a consistent and interoperable implementation
dotnet_diagnostic.SYSLIB0044.severity = error # AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete
dotnet_diagnostic.SYSLIB0045.severity = error # Cryptographic factory methods accepting an algorithm name are obsolete
dotnet_diagnostic.SYSLIB0046.severity = error # ControlledExecution.Run may corrupt the process and should not be used in production code
dotnet_diagnostic.SYSLIB0047.severity = error # XmlSecureResolver is obsolete
dotnet_diagnostic.SYSLIB0048.severity = error # RSA.EncryptValue and RSA.DecryptValue are not supported and throw NotSupportedException
dotnet_diagnostic.SYSLIB0049.severity = error # JsonSerializerOptions.AddContext is obsolete
dotnet_diagnostic.SYSLIB0050.severity = error # Formatter-based serialization (ISerializable, FormatterServices, etc.) is obsolete
dotnet_diagnostic.SYSLIB0051.severity = error # The Exception API ISerializable / GetObjectData formatter-based serialization is obsolete
dotnet_diagnostic.SYSLIB0052.severity = error # Members for assigning to AssemblyName.CodeBase or AssemblyName.EscapedCodeBase are obsolete
dotnet_diagnostic.SYSLIB0053.severity = error # AesGcm should indicate the required tag size for encryption and decryption
dotnet_diagnostic.SYSLIB0054.severity = error # Strong name signing is not supported and throws PlatformNotSupportedException
dotnet_diagnostic.SYSLIB0055.severity = error # 'Memory.Pin' may be incorrectly used with structures
dotnet_diagnostic.SYSLIB0056.severity = error # LoadFromHash and related members are obsolete
dotnet_diagnostic.SYSLIB0057.severity = error # Use X509CertificateLoader instead to load certificates
dotnet_diagnostic.SYSLIB0058.severity = error # KeyExchangeAlgorithm and KeyExchangeStrength are obsolete on SslStream
dotnet_diagnostic.SYSLIB0059.severity = error # SystemEvents.EventsThreadShutdown event is obsolete
dotnet_diagnostic.SYSLIB0060.severity = error # Constructors of DirectoryServices.ActiveDirectory.ConfigurationContext are obsolete
dotnet_diagnostic.SYSLIB0061.severity = error # CryptographyConfig.AddOID and AddAlgorithm methods are obsolete
###################
# Microsoft .NET Source Generator Diagnostics (SYSLIB1xxx)
###################
# LoggerMessage source generator
dotnet_diagnostic.SYSLIB1001.severity = error # Logging method names cannot start with _
dotnet_diagnostic.SYSLIB1002.severity = error # Don't include log level parameters as templates in the logging message
dotnet_diagnostic.SYSLIB1003.severity = error # LoggerMessage attribute log level value must be defined
dotnet_diagnostic.SYSLIB1004.severity = error # Logging class cannot be in nested types
dotnet_diagnostic.SYSLIB1005.severity = error # Could not find a required type definition
dotnet_diagnostic.SYSLIB1006.severity = error # Multiple logging methods cannot use the same event ID within a class
dotnet_diagnostic.SYSLIB1007.severity = error # Logging methods must return void
dotnet_diagnostic.SYSLIB1008.severity = error # One of the arguments to a logging method must implement ILogger
dotnet_diagnostic.SYSLIB1009.severity = error # Logging methods must be static
dotnet_diagnostic.SYSLIB1010.severity = error # Logging methods must be partial
dotnet_diagnostic.SYSLIB1011.severity = error # Logging methods cannot be generic
dotnet_diagnostic.SYSLIB1012.severity = error # Logging methods must not have a body
dotnet_diagnostic.SYSLIB1013.severity = error # Missing logger argument to logging method
dotnet_diagnostic.SYSLIB1015.severity = error # Argument is not referenced from the logging message
dotnet_diagnostic.SYSLIB1016.severity = error # Logging methods cannot have a parameter named the same as one of the template parameters
dotnet_diagnostic.SYSLIB1017.severity = error # Logging methods cannot have more than one parameter of type LogLevel
dotnet_diagnostic.SYSLIB1018.severity = error # Logging method parameter doesn't appear in template
dotnet_diagnostic.SYSLIB1019.severity = error # Couldn't find a field of type ILogger
dotnet_diagnostic.SYSLIB1020.severity = error # Found multiple fields of type ILogger
dotnet_diagnostic.SYSLIB1021.severity = error # Cannot have multiple logging methods with the same name
dotnet_diagnostic.SYSLIB1022.severity = error # Logging methods cannot have multiple template parameters with the same name
dotnet_diagnostic.SYSLIB1023.severity = error # Generating more than 6 arguments is not supported
dotnet_diagnostic.SYSLIB1024.severity = error # Logging method template name conflicts with a method parameter name
dotnet_diagnostic.SYSLIB1025.severity = error # Multiple template parameters with the same name
# Skipped SYSLIB1014 (Reserved)
# System.Text.Json source generator
dotnet_diagnostic.SYSLIB1030.severity = error # JsonSourceGenerator did not generate serialization metadata for type
dotnet_diagnostic.SYSLIB1031.severity = error # Duplicate type registration in JsonSerializerContext
dotnet_diagnostic.SYSLIB1032.severity = error # JsonSerializerContext classes must be partial
dotnet_diagnostic.SYSLIB1033.severity = error # Serializable types must have at least one constructor
dotnet_diagnostic.SYSLIB1034.severity = error # Type uses an unsupported [JsonExtensionData] property
dotnet_diagnostic.SYSLIB1036.severity = error # Init-only properties are not supported in source generation
dotnet_diagnostic.SYSLIB1037.severity = error # Source generator does not support [JsonInclude] on inaccessible members
dotnet_diagnostic.SYSLIB1038.severity = error # JsonInclude on a non-public property is not supported
dotnet_diagnostic.SYSLIB1039.severity = error # Type with extension data of unsupported shape
dotnet_diagnostic.SYSLIB1040.severity = error # Type with cycles is not supported
dotnet_diagnostic.SYSLIB1041.severity = error # Duplicate type names registered with JsonSerializerContext
# Skipped SYSLIB1035 (Reserved)
# GeneratedRegex source generator
dotnet_diagnostic.SYSLIB1042.severity = error # Use 'GeneratedRegexAttribute' for static regex creation
dotnet_diagnostic.SYSLIB1043.severity = error # The regex pattern is not valid
dotnet_diagnostic.SYSLIB1044.severity = error # The regex source generator failed
dotnet_diagnostic.SYSLIB1045.severity = error # Convert to 'GeneratedRegexAttribute' for compile-time regex generation
dotnet_diagnostic.SYSLIB1046.severity = error # Could not find an applicable Regex constructor
dotnet_diagnostic.SYSLIB1047.severity = error # The regex options are not valid for source generation
dotnet_diagnostic.SYSLIB1048.severity = error # GeneratedRegex source generator encountered an unhandled error
dotnet_diagnostic.SYSLIB1049.severity = error # Multiple regex source generators conflict
# LibraryImport (P/Invoke) source generator
dotnet_diagnostic.SYSLIB1050.severity = error # Method should be marked 'LibraryImport' instead of 'DllImport'
dotnet_diagnostic.SYSLIB1051.severity = error # Specified type is not supported by source-generated P/Invokes
dotnet_diagnostic.SYSLIB1052.severity = error # Specified configuration is not supported by source-generated P/Invokes
dotnet_diagnostic.SYSLIB1053.severity = error # 'LibraryImportAttribute' requires unsafe code
dotnet_diagnostic.SYSLIB1054.severity = error # Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
dotnet_diagnostic.SYSLIB1055.severity = error # Invalid 'CustomMarshallerAttribute' usage
dotnet_diagnostic.SYSLIB1056.severity = error # Specified marshaller type is invalid
dotnet_diagnostic.SYSLIB1057.severity = error # Marshaller type does not have the required shape
dotnet_diagnostic.SYSLIB1058.severity = error # Invalid 'NativeMarshallingAttribute' usage
dotnet_diagnostic.SYSLIB1059.severity = error # Marshaller type must be a closed generic type
dotnet_diagnostic.SYSLIB1060.severity = error # Specified native type is invalid
dotnet_diagnostic.SYSLIB1061.severity = error # Marshaller type has incompatible method signatures
dotnet_diagnostic.SYSLIB1062.severity = error # Project must be updated with '<AllowUnsafeBlocks>true</AllowUnsafeBlocks>'
dotnet_diagnostic.SYSLIB1063.severity = error # 'CustomMarshaller' types must have an 'in' or 'ref' first parameter
dotnet_diagnostic.SYSLIB1064.severity = error # Forwarder marshaller types should not have 'GenericPlaceholder'
# GeneratedComInterface / COM source generator
dotnet_diagnostic.SYSLIB1090.severity = error # Convert to 'GeneratedComInterface'
dotnet_diagnostic.SYSLIB1091.severity = error # Type is an invalid 'GeneratedComInterface' base interface
dotnet_diagnostic.SYSLIB1092.severity = error # 'GeneratedComInterface' must specify 'Guid'
dotnet_diagnostic.SYSLIB1093.severity = error # Method on 'GeneratedComInterface' has unsupported return type
dotnet_diagnostic.SYSLIB1094.severity = error # Method on 'GeneratedComInterface' has unsupported parameter
dotnet_diagnostic.SYSLIB1095.severity = error # Type implements 'GeneratedComInterface' but is not partial
dotnet_diagnostic.SYSLIB1096.severity = error # 'GeneratedComClassAttribute' must be applied to a partial type
dotnet_diagnostic.SYSLIB1097.severity = error # 'GeneratedComClassAttribute' type must implement at least one 'GeneratedComInterface'
dotnet_diagnostic.SYSLIB1098.severity = error # 'GeneratedComInterface' interface inheritance not supported
# Configuration binding source generator
dotnet_diagnostic.SYSLIB1100.severity = error # Configuration binding source generator: type is not supported
dotnet_diagnostic.SYSLIB1101.severity = error # Configuration binding source generator: property on type is not supported
dotnet_diagnostic.SYSLIB1102.severity = error # Configuration binding source generator: not enabled
dotnet_diagnostic.SYSLIB1103.severity = error # Configuration binding source generator: type lacks a parameterless constructor
dotnet_diagnostic.SYSLIB1104.severity = error # Configuration binding source generator: language version is too low
###################
# Microsoft .NET Style Rules (IDExxxx) - Language Rules
###################
# EnforceCodeStyleInBuild=true (set in Directory.Build.props) promotes these
# IDE rules into `dotnet build` so they fire at compile time, not just in the
# IDE. We enable the ones that are unambiguous wins and skip the rules that
# conflict with an existing convention (SA1101, SA1200, SA1206, SA1400, SA1633,
# etc.) so we don't double-report.
# Bug catchers — always error.
dotnet_diagnostic.IDE0035.severity = error # Remove unreachable code
dotnet_diagnostic.IDE0043.severity = error # Format string contains invalid placeholder
dotnet_diagnostic.IDE0051.severity = error # Remove unused private member
dotnet_diagnostic.IDE0052.severity = error # Remove unread private member
dotnet_diagnostic.IDE0076.severity = error # Remove invalid global SuppressMessage attribute
dotnet_diagnostic.IDE0077.severity = error # Avoid legacy format target in global SuppressMessage attribute
dotnet_diagnostic.IDE0080.severity = error # Remove unnecessary suppression operator
# Simplification / cleanup.
dotnet_diagnostic.IDE0001.severity = error # Simplify name
dotnet_diagnostic.IDE0002.severity = error # Simplify member access
dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast — disabled because we deliberately keep explicit casts in Apple platform-specific paths and other reflection/marshalling sites where the analyzer's "redundant" judgement is wrong
dotnet_diagnostic.IDE0005.severity = error # Remove unnecessary import
dotnet_diagnostic.IDE0016.severity = error # Use throw expression
dotnet_diagnostic.IDE0017.severity = error # Use object initializers
dotnet_diagnostic.IDE0018.severity = error # Inline variable declaration
dotnet_diagnostic.IDE0019.severity = error # Use pattern matching to avoid 'as' followed by a 'null' check
dotnet_diagnostic.IDE0020.severity = error # Use pattern matching to avoid 'is' check followed by a cast
dotnet_diagnostic.IDE0028.severity = error # Use collection initializers
dotnet_diagnostic.IDE0029.severity = none # Use coalesce expression — handled by RCS1128
dotnet_diagnostic.IDE0030.severity = error # Use coalesce expression (nullable types)
dotnet_diagnostic.IDE0031.severity = none # Use null propagation — handled by RCS1146
dotnet_diagnostic.IDE0032.severity = none # Use auto property — handled by RCS1085
dotnet_diagnostic.IDE0033.severity = error # Use explicitly provided tuple name
dotnet_diagnostic.IDE0034.severity = error # Simplify default expression
dotnet_diagnostic.IDE0037.severity = error # Use inferred member name
dotnet_diagnostic.IDE0038.severity = error # Use pattern matching ('is' check without a cast)
dotnet_diagnostic.IDE0041.severity = error # Use 'is null' check
dotnet_diagnostic.IDE0042.severity = error # Deconstruct variable declaration
dotnet_diagnostic.IDE0044.severity = error # Add readonly modifier
dotnet_diagnostic.IDE0046.severity = suggestion # Use conditional expression for return — downgraded because nested coalescing/ternary chains it produces hurt readability
dotnet_diagnostic.IDE0047.severity = error # Remove unnecessary parentheses
dotnet_diagnostic.IDE0049.severity = error # Use language keywords instead of framework type names for type references
dotnet_diagnostic.IDE0054.severity = error # Use compound assignment
dotnet_diagnostic.IDE0056.severity = suggestion # Use index operator
dotnet_diagnostic.IDE0057.severity = suggestion # Use range operator
dotnet_diagnostic.IDE0059.severity = error # Remove unnecessary value assignment
dotnet_diagnostic.IDE0062.severity = error # Make local function static
dotnet_diagnostic.IDE0063.severity = error # Use simple 'using' statement
dotnet_diagnostic.IDE0064.severity = error # Make struct fields writable — flag readonly-but-mutable struct fields where intent diverges from declaration
dotnet_diagnostic.IDE0066.severity = error # Use switch expression
dotnet_diagnostic.IDE0070.severity = error # Use 'System.HashCode.Combine'
dotnet_diagnostic.IDE0071.severity = error # Simplify interpolation
dotnet_diagnostic.IDE0072.severity = suggestion # Add missing cases to switch expression - sometimes we miss switch cases dilberately.
dotnet_diagnostic.IDE0074.severity = error # Use compound assignment
dotnet_diagnostic.IDE0075.severity = error # Simplify conditional expression
dotnet_diagnostic.IDE0078.severity = error # Use pattern matching
dotnet_diagnostic.IDE0082.severity = error # Convert typeof to nameof
dotnet_diagnostic.IDE0083.severity = error # Use pattern matching ('not' operator)
dotnet_diagnostic.IDE0084.severity = error # Use pattern matching ('IsNot' operator)
dotnet_diagnostic.IDE0090.severity = error # Simplify 'new' expression
dotnet_diagnostic.IDE0100.severity = error # Remove unnecessary equality operator
dotnet_diagnostic.IDE0110.severity = error # Remove unnecessary discard
dotnet_diagnostic.IDE0120.severity = error # Simplify LINQ expression
dotnet_diagnostic.IDE0150.severity = error # Prefer 'null' check over type check
dotnet_diagnostic.IDE0161.severity = error # Use file-scoped namespace declaration
dotnet_diagnostic.IDE0170.severity = error # Simplify property pattern
dotnet_diagnostic.IDE0180.severity = error # Use tuple to swap values
dotnet_diagnostic.IDE0200.severity = error # Remove unnecessary lambda expression
dotnet_diagnostic.IDE0220.severity = error # Add explicit cast in foreach loop
dotnet_diagnostic.IDE0240.severity = error # Remove redundant nullable directive
dotnet_diagnostic.IDE0241.severity = error # Remove unnecessary nullable directive
dotnet_diagnostic.IDE0250.severity = error # Make struct 'readonly'
dotnet_diagnostic.IDE0251.severity = error # Make member 'readonly'
dotnet_diagnostic.IDE0260.severity = error # Use pattern matching
dotnet_diagnostic.IDE0270.severity = error # Use coalesce expression
# Disabled — conflict with an existing SA/CA rule or project convention.
dotnet_diagnostic.IDE0003.severity = none # Remove 'this' qualifier — we don't follow the this. prefix style (SA1101 = none)
dotnet_diagnostic.IDE0007.severity = none # Use var — we don't force var in either direction
dotnet_diagnostic.IDE0008.severity = none # Use explicit type — we don't force var in either direction
dotnet_diagnostic.IDE0009.severity = none # Member access should be qualified — SA1101 = none
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement — too noisy for default/fallthrough patterns
dotnet_diagnostic.IDE0011.severity = none # Add braces — RCS1001 / RCS1007 already handle this
dotnet_diagnostic.IDE0021.severity = none # Use expression body for constructors — preference not enforced
dotnet_diagnostic.IDE0022.severity = none # Use expression body for methods — preference not enforced
dotnet_diagnostic.IDE0023.severity = none # Use expression body for conversion operators — preference not enforced
dotnet_diagnostic.IDE0024.severity = none # Use expression body for operators — preference not enforced
dotnet_diagnostic.IDE0025.severity = none # Use expression body for properties — preference not enforced
dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers — preference not enforced
dotnet_diagnostic.IDE0027.severity = none # Use expression body for accessors — preference not enforced
dotnet_diagnostic.IDE0036.severity = none # Order modifiers — SA1206 handles
dotnet_diagnostic.IDE0039.severity = none # Use local function — anonymous method preference not enforced
dotnet_diagnostic.IDE0040.severity = none # Add accessibility modifiers — SA1400 handles
dotnet_diagnostic.IDE0045.severity = none # Use conditional expression for assignment — preference not enforced
dotnet_diagnostic.IDE0048.severity = none # Add parentheses for clarity — preference not enforced
dotnet_diagnostic.IDE0053.severity = none # Use expression body for lambdas — preference not enforced
dotnet_diagnostic.IDE0055.severity = none # Formatting — StyleCop SA rules own formatting
dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value — too noisy (ignores fluent APIs)
dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter — CA1801 handles (with api_surface config)
dotnet_diagnostic.IDE0061.severity = none # Use expression body for local function — preference not enforced
dotnet_diagnostic.IDE0065.severity = none # 'using' directive placement — SA1200 = none (we put usings outside file-scoped namespaces)
dotnet_diagnostic.IDE0073.severity = none # Require file header — SA1633 handles
dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression — can misfire on multi-TFM suppressions
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure — we don't enforce strict mirror
dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace — we use file-scoped (IDE0161)
dotnet_diagnostic.IDE0210.severity = none # Convert to top-level statements — we use Main style
dotnet_diagnostic.IDE0211.severity = none # Convert to 'Program.Main' style — we use Main style
dotnet_diagnostic.IDE0280.severity = none # Use nameof — CA1507 / RCS1015 handle this
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor — subjective, not enforced
dotnet_diagnostic.IDE0300.severity = error # Use collection expression for array
dotnet_diagnostic.IDE0301.severity = error # Use collection expression for empty
dotnet_diagnostic.IDE0302.severity = error # Use collection expression for stackalloc
dotnet_diagnostic.IDE0303.severity = error # Use collection expression for Create
dotnet_diagnostic.IDE0304.severity = error # Use collection expression for builder
dotnet_diagnostic.IDE0305.severity = error # Use collection expression for fluent
dotnet_diagnostic.IDE0306.severity = error # Use collection expression for new
dotnet_diagnostic.IDE0320.severity = error # Make anonymous function static — eliminates the closure-capture display class allocation
dotnet_diagnostic.IDE0050.severity = error # Convert anonymous type to tuple
dotnet_diagnostic.IDE0230.severity = error # Use UTF-8 string literal — better hot-path encoding for byte-array constants
dotnet_diagnostic.IDE0310.severity = none # Convert lambda expression to method group — handled by RCS1207
dotnet_diagnostic.IDE0370.severity = none # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform
dotnet_diagnostic.IDE0380.severity = error # Remove unnecessary unsafe modifier
dotnet_diagnostic.IDE1005.severity = error # Use conditional delegate call
###################
# Microsoft .NET Style Rules (IDE1xxx / IDE3xxx) - Naming & Miscellaneous
###################
# Naming conventions — SA1300 family already enforces PascalCase / interface
# prefix / field casing (with our _underscore convention on SA1306/1309/1311
# deliberately disabled). Leaving IDE1006 off because configuring
# `dotnet_naming_rule.*` would duplicate what SA already enforces and could
# conflict with the _underscore convention.
dotnet_diagnostic.IDE1006.severity = none # Naming rule violation — SA1300 family handles naming
dotnet_diagnostic.IDE3000.severity = none # Disabled per project convention — not enforced
###################
# Roslynator Analyzers (RCS1xxx) - Code Simplification
###################
dotnet_diagnostic.RCS1001.severity = error # Add braces (when expression spans over multiple lines)
dotnet_diagnostic.RCS1003.severity = error # Add braces to if-else (when expression spans over multiple lines)
dotnet_diagnostic.RCS1005.severity = error # Simplify nested using statement
dotnet_diagnostic.RCS1006.severity = error # Merge 'else' with nested 'if'
dotnet_diagnostic.RCS1007.severity = error # Add braces
dotnet_diagnostic.RCS1031.severity = none # Remove unnecessary braces in switch section -- we don't mind braces in switch statements
dotnet_diagnostic.RCS1032.severity = error # Remove redundant parentheses
dotnet_diagnostic.RCS1033.severity = error # Remove redundant boolean literal
dotnet_diagnostic.RCS1039.severity = error # Remove argument list from attribute
dotnet_diagnostic.RCS1042.severity = error # Remove enum default underlying type
dotnet_diagnostic.RCS1043.severity = error # Remove 'partial' modifier from type with a single part
dotnet_diagnostic.RCS1049.severity = error # Simplify boolean comparison
dotnet_diagnostic.RCS1058.severity = error # Use compound assignment
dotnet_diagnostic.RCS1061.severity = error # Merge 'if' with nested 'if'
dotnet_diagnostic.RCS1068.severity = error # Simplify logical negation
dotnet_diagnostic.RCS1069.severity = error # Remove unnecessary case label
dotnet_diagnostic.RCS1070.severity = error # Remove redundant default switch section
dotnet_diagnostic.RCS1071.severity = error # Remove redundant base constructor call
dotnet_diagnostic.RCS1073.severity = error # Convert 'if' to 'return' statement
dotnet_diagnostic.RCS1074.severity = error # Remove redundant constructor
dotnet_diagnostic.RCS1078.severity = error # Use "" or 'string.Empty'
dotnet_diagnostic.RCS1084.severity = error # Use coalesce expression instead of conditional expression
dotnet_diagnostic.RCS1085.severity = error # Use auto-implemented property
dotnet_diagnostic.RCS1089.severity = error # Use --/++ operator instead of assignment
dotnet_diagnostic.RCS1097.severity = error # Remove redundant 'ToString' call
dotnet_diagnostic.RCS1103.severity = error # Convert 'if' to assignment
dotnet_diagnostic.RCS1104.severity = error # Simplify conditional expression
dotnet_diagnostic.RCS1105.severity = error # Unnecessary interpolation
dotnet_diagnostic.RCS1107.severity = error # Remove redundant 'ToCharArray' call
dotnet_diagnostic.RCS1114.severity = error # Remove redundant delegate creation
dotnet_diagnostic.RCS1124.severity = error # Inline local variable
dotnet_diagnostic.RCS1126.severity = error # Add braces to if-else
dotnet_diagnostic.RCS1128.severity = error # Use coalesce expression
dotnet_diagnostic.RCS1129.severity = error # Remove redundant field initialization
dotnet_diagnostic.RCS1132.severity = error # Remove redundant overriding member
dotnet_diagnostic.RCS1133.severity = error # Remove redundant Dispose/Close call
dotnet_diagnostic.RCS1134.severity = error # Remove redundant statement
dotnet_diagnostic.RCS1143.severity = error # Simplify coalesce expression
dotnet_diagnostic.RCS1145.severity = error # Remove redundant 'as' operator
dotnet_diagnostic.RCS1146.severity = error # Use conditional access
dotnet_diagnostic.RCS1151.severity = error # Remove redundant cast
dotnet_diagnostic.RCS1171.severity = error # Simplify lazy initialization
dotnet_diagnostic.RCS1173.severity = error # Use coalesce expression instead of 'if'
dotnet_diagnostic.RCS1174.severity = error # Remove redundant async/await
dotnet_diagnostic.RCS1179.severity = error # Unnecessary assignment
dotnet_diagnostic.RCS1180.severity = error # Inline lazy initialization
dotnet_diagnostic.RCS1188.severity = error # Remove redundant auto-property initialization
dotnet_diagnostic.RCS1192.severity = error # Unnecessary usage of verbatim string literal
dotnet_diagnostic.RCS1199.severity = error # Unnecessary null check
dotnet_diagnostic.RCS1206.severity = error # Use conditional access instead of conditional expression
dotnet_diagnostic.RCS1207.severity = error # Use anonymous function or method group
dotnet_diagnostic.RCS1211.severity = error # Remove unnecessary 'else'
dotnet_diagnostic.RCS1212.severity = error # Remove redundant assignment
dotnet_diagnostic.RCS1214.severity = error # Unnecessary interpolated string
dotnet_diagnostic.RCS1216.severity = error # Unnecessary unsafe context
dotnet_diagnostic.RCS1217.severity = error # Convert interpolated string to concatenation
dotnet_diagnostic.RCS1218.severity = error # Simplify code branching
dotnet_diagnostic.RCS1220.severity = error # Use pattern matching instead of combination of 'is' and cast
dotnet_diagnostic.RCS1221.severity = error # Use pattern matching instead of combination of 'as' and null check
dotnet_diagnostic.RCS1238.severity = error # Avoid nested ?: operators
dotnet_diagnostic.RCS1244.severity = error # Simplify 'default' expression
dotnet_diagnostic.RCS1249.severity = none # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives
dotnet_diagnostic.RCS1251.severity = error # Remove unnecessary braces from record declaration
dotnet_diagnostic.RCS1259.severity = error # Remove empty syntax (replaces RCS1066)
dotnet_diagnostic.RCS1262.severity = error # Unnecessary raw string literal
dotnet_diagnostic.RCS1265.severity = error # Remove redundant catch block
dotnet_diagnostic.RCS1268.severity = error # Simplify numeric comparison
###################
# Roslynator Analyzers (RCS1xxx) - Code Quality
###################
dotnet_diagnostic.RCS1013.severity = error # Use predefined type
dotnet_diagnostic.RCS1014.severity = error # Use explicitly/implicitly typed array
dotnet_diagnostic.RCS1015.severity = error # Use nameof operator
dotnet_diagnostic.RCS1016.severity = error # Use block body or expression body
dotnet_diagnostic.RCS1020.severity = error # Simplify Nullable<T> to T?
dotnet_diagnostic.RCS1021.severity = error # Convert lambda expression body to expression body
dotnet_diagnostic.RCS1044.severity = error # Remove original exception from throw statement
dotnet_diagnostic.RCS1046.severity = none # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix
dotnet_diagnostic.RCS1047.severity = error # Non-asynchronous method name should not end with 'Async'
dotnet_diagnostic.RCS1048.severity = error # Use lambda expression instead of anonymous method
dotnet_diagnostic.RCS1050.severity = error # Include/omit parentheses when creating new object
dotnet_diagnostic.RCS1051.severity = error # Add/remove parentheses from condition in conditional operator
dotnet_diagnostic.RCS1056.severity = none # Avoid usage of using alias directive - used to avoid conflicts
dotnet_diagnostic.RCS1059.severity = error # Avoid locking on publicly accessible instance
dotnet_diagnostic.RCS1075.severity = error # Avoid empty catch clause that catches System.Exception
dotnet_diagnostic.RCS1079.severity = error # Throwing of new NotImplementedException
dotnet_diagnostic.RCS1081.severity = error # Split variable declaration
dotnet_diagnostic.RCS1093.severity = error # File contains no code
dotnet_diagnostic.RCS1094.severity = error # Declare using directive on top level
dotnet_diagnostic.RCS1096.severity = error # Use 'HasFlag' method or bitwise operator
dotnet_diagnostic.RCS1098.severity = error # Constant values should be placed on right side of comparisons
dotnet_diagnostic.RCS1099.severity = error # Default label should be the last label in a switch section
dotnet_diagnostic.RCS1102.severity = error # Make class static
dotnet_diagnostic.RCS1108.severity = error # Add 'static' modifier to all partial class declarations
dotnet_diagnostic.RCS1111.severity = error # Add braces to switch section with multiple statements
dotnet_diagnostic.RCS1113.severity = error # Use 'string.IsNullOrEmpty' method
dotnet_diagnostic.RCS1118.severity = error # Mark local variable as const
dotnet_diagnostic.RCS1123.severity = error # Add parentheses when necessary
dotnet_diagnostic.RCS1130.severity = error # Bitwise operation on enum without Flags attribute
dotnet_diagnostic.RCS1135.severity = error # Declare enum member with zero value (when enum has FlagsAttribute)
dotnet_diagnostic.RCS1136.severity = error # Merge switch sections with equivalent content
dotnet_diagnostic.RCS1154.severity = error # Sort enum members
dotnet_diagnostic.RCS1155.severity = error # Use StringComparison when comparing strings
dotnet_diagnostic.RCS1156.severity = error # Use string.Length instead of comparison with empty string
dotnet_diagnostic.RCS1157.severity = error # Composite enum value contains undefined flag
dotnet_diagnostic.RCS1159.severity = error # Use EventHandler<T>
dotnet_diagnostic.RCS1160.severity = error # Abstract type should not have public constructors
dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit values - do not need explicit values
dotnet_diagnostic.RCS1162.severity = error # Avoid chain of assignments
dotnet_diagnostic.RCS1166.severity = error # Value type object is never equal to null
dotnet_diagnostic.RCS1168.severity = suggestion # Parameter name differs from base name
dotnet_diagnostic.RCS1169.severity = error # Make field read-only
dotnet_diagnostic.RCS1170.severity = error # Use read-only auto-implemented property
dotnet_diagnostic.RCS1172.severity = error # Use 'is' operator instead of 'as' operator
dotnet_diagnostic.RCS1187.severity = error # Use constant instead of field
dotnet_diagnostic.RCS1191.severity = error # Declare enum value as combination of names
dotnet_diagnostic.RCS1193.severity = error # Overriding member should not change 'params' modifier
dotnet_diagnostic.RCS1196.severity = error # Call extension method as instance method
dotnet_diagnostic.RCS1200.severity = error # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'
dotnet_diagnostic.RCS1201.severity = error # Use method chaining
dotnet_diagnostic.RCS1202.severity = error # Avoid NullReferenceException
dotnet_diagnostic.RCS1204.severity = error # Use EventArgs.Empty
dotnet_diagnostic.RCS1205.severity = error # Order named arguments according to the order of parameters
dotnet_diagnostic.RCS1208.severity = error # Reduce 'if' nesting
dotnet_diagnostic.RCS1209.severity = error # Order type parameter constraints
dotnet_diagnostic.RCS1210.severity = error # Return completed task instead of returning null
dotnet_diagnostic.RCS1215.severity = error # Expression is always equal to true/false
dotnet_diagnostic.RCS1222.severity = error # Merge preprocessor directives
dotnet_diagnostic.RCS1223.severity = suggestion # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error
dotnet_diagnostic.RCS1224.severity = error # Make method an extension method
dotnet_diagnostic.RCS1225.severity = error # Make class sealed
dotnet_diagnostic.RCS1227.severity = error # Validate arguments correctly
dotnet_diagnostic.RCS1229.severity = error # Use async/await when necessary
dotnet_diagnostic.RCS1231.severity = suggestion # Make parameter ref read-only
dotnet_diagnostic.RCS1233.severity = error # Use short-circuiting operator
dotnet_diagnostic.RCS1234.severity = error # Duplicate enum value
dotnet_diagnostic.RCS1239.severity = error # Use 'for' statement instead of 'while' statement
dotnet_diagnostic.RCS1240.severity = error # Operator is unnecessary
dotnet_diagnostic.RCS1242.severity = error # Do not pass non-read-only struct by read-only reference
dotnet_diagnostic.RCS1243.severity = error # Duplicate word in a comment
dotnet_diagnostic.RCS1247.severity = error # Fix documentation comment tag
dotnet_diagnostic.RCS1248.severity = error # Normalize null check
dotnet_diagnostic.RCS1250.severity = error # Use implicit/explicit object creation
dotnet_diagnostic.RCS1252.severity = error # Normalize usage of infinite loop
dotnet_diagnostic.RCS1254.severity = error # Normalize format of enum flag value
dotnet_diagnostic.RCS1255.severity = none # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern
dotnet_diagnostic.RCS1257.severity = error # Use enum field explicitly
dotnet_diagnostic.RCS1258.severity = error # Unnecessary enum flag
dotnet_diagnostic.RCS1260.severity = error # Add/remove trailing comma
dotnet_diagnostic.RCS1261.severity = error # Resource can be disposed asynchronously
dotnet_diagnostic.RCS1264.severity = error # Use 'var' or explicit type (replaces RCS1010, RCS1176, RCS1177)
dotnet_diagnostic.RCS1266.severity = error # Use raw string literal
dotnet_diagnostic.RCS1267.severity = error # Use string interpolation instead of 'string.Concat'
###################
# Roslynator Analyzers (RCS1xxx) - Performance
###################
dotnet_diagnostic.RCS1077.severity = error # Optimize LINQ method call
dotnet_diagnostic.RCS1080.severity = error # Use 'Count/Length' property instead of 'Any' method
dotnet_diagnostic.RCS1112.severity = error # Combine 'Enumerable.Where' method chain
dotnet_diagnostic.RCS1186.severity = error # Use Regex instance instead of static method
dotnet_diagnostic.RCS1190.severity = error # Join string expressions
dotnet_diagnostic.RCS1195.severity = error # Use ^ operator