forked from sshnet/SSH.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.editorconfig
1246 lines (991 loc) · 44.7 KB
/
.editorconfig
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
// Avoid looking for .editorconfig files in parent directories
root=true
[*]
insert_final_newline = true
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = crlf
[*.cs]
#### Sonar rules ####
# S101: Types should be named in PascalCase
# https://rules.sonarsource.com/csharp/RSPEC-101
#
# TODO: Remove this when code has been updated!
dotnet_diagnostic.S101.severity = none
# S112: General exceptions should never be thrown
# https://rules.sonarsource.com/csharp/RSPEC-112
#
# This is a duplicate of CA2201 and MA0012.
dotnet_diagnostic.S112.severity = none
# S907: Remove use of 'goto'
# https://rules.sonarsource.com/csharp/RSPEC-907
#
# Limited use of 'goto' is accepted when performance is critical.
dotnet_diagnostic.S907.severity = none
# S1066: Collapsible "if" statements should be merged
# https://rules.sonarsource.com/csharp/RSPEC-1066
#
dotnet_diagnostic.S1066.severity = none
# S1075: URIs should not be hardcoded
# https://rules.sonarsource.com/csharp/RSPEC-1075
#
# The rule reports false positives for XML namespaces.
dotnet_diagnostic.S1075.severity = none
# S1104: Fields should not have public accessibility
# https://rules.sonarsource.com/csharp/RSPEC-1104
#
# This is a duplicate of SA1401 and CA1051.
dotnet_diagnostic.S1104.severity = none
# S1125: Boolean literals should not be redundant
# https://rules.sonarsource.com/csharp/RSPEC-1125
#
# This is a duplicate of MA0073.
dotnet_diagnostic.S1125.severity = none
# S1135: Track uses of "TODO" tags
#
# This is a duplicate of MA0026.
dotnet_diagnostic.S1135.severity = none
# S1168: Empty arrays and collections should be returned instead of null
# https://rules.sonarsource.com/csharp/RSPEC-1168
#
# We sometimes return null to avoid allocating an empty List<T>.
dotnet_diagnostic.S1168.severity = none
# S1172: Unused method parameters should be removed
# https://rules.sonarsource.com/csharp/RSPEC-1172
#
# This is a duplicate of IDE0060.
dotnet_diagnostic.S1172.severity = none
# S1481: Unused local variables should be removed
# https://rules.sonarsource.com/csharp/RSPEC-1481
#
# This is a duplicate of IDE0059.
dotnet_diagnostic.S1481.severity = none
# S2259: Null pointers should not be dereferenced
# https://rules.sonarsource.com/csharp/RSPEC-2259
#
# The analysis is not precise enough, leading to false positives.
dotnet_diagnostic.S2259.severity = none
# S2445: Blocks should be synchronized on read-only fields
# https://rules.sonarsource.com/csharp/RSPEC-2445
#
# This is a (partial) duplicate of MA0064.
dotnet_diagnostic.S2445.severity = none
# S2551: Shared resources should not be used for locking
# https://rules.sonarsource.com/csharp/RSPEC-2551
#
# This is a duplicate of CA2002, and partial duplicate of MA0064.
dotnet_diagnostic.S2551.severity = none
# S2583: Conditionally executed code should be reachable
# https://rules.sonarsource.com/csharp/RSPEC-2583
#
# This rule produces false errors in, for example, for loops.
#dotnet_diagnostic.S2583.severity = none
# S2699: Tests should include assertions
# https://rules.sonarsource.com/csharp/RSPEC-2699
#
# Sometimes you want a test in which you invoke a method and just want to verify that it does not throw.
# For example:
# [TestMethod]
# public void InvokeDisposeWithoutNotifyObjectShouldNotThrow()
# {
# _timer.Dispose();
# }
dotnet_diagnostic.S2699.severity = none
# S2933: Fields that are only assigned in the constructor should be "readonly"
# https://rules.sonarsource.com/csharp/RSPEC-2933
#
# This is a duplicate of IDE0044, but IDE0044 is not reported when targeting .NET Framework 4.8.
dotnet_diagnostic.S2933.severity = none
# S2971: "IEnumerable" LINQs should be simplified
# https://rules.sonarsource.com/csharp/RSPEC-2971
#
# This is a duplicate of MA0020.
dotnet_diagnostic.S2971.severity = none
# S3218: Inner class members should not shadow outer class "static" or type members
# https://rules.sonarsource.com/csharp/RSPEC-3218
#
# This is rather harmless.
dotnet_diagnostic.S3218.severity = none
# S3267: Loops should be simplified with "LINQ" expressions
# https://rules.sonarsource.com/csharp/RSPEC-3267
#
# LINQ is the root of all evil :p
dotnet_diagnostic.S3267.severity = none
# S3376: Attribute, EventArgs, and Exception type names should end with the type being extended
# https://rules.sonarsource.com/csharp/RSPEC-3376
#
# This is a partial duplicate of MA0058. If we enable the Sonar in all repositories, we should
# consider enabling S3376 in favor of MA0058.
dotnet_diagnostic.S3376.severity = none
# S3871: Exception types should be "public"
# https://rules.sonarsource.com/csharp/RSPEC-3871
#
# This is a duplicate of CA1064.
dotnet_diagnostic.S3871.severity = none
# S3925: "ISerializable" should be implemented correctly
# https://rules.sonarsource.com/csharp/RSPEC-3925
#
# This is a duplicate of CA2229.
dotnet_diagnostic.S3925.severity = none
# S3928: Parameter names used into ArgumentException constructors should match an existing one
# https://rules.sonarsource.com/csharp/RSPEC-3928
#
# This is a duplicate of MA0015.
dotnet_diagnostic.S3928.severity = none
# S3998: Threads should not lock on objects with weak identity
# https://rules.sonarsource.com/csharp/RSPEC-3998
#
# This is a duplicate of CA2002, and partial duplicate of MA0064.
dotnet_diagnostic.S3998.severity = none
# S4456: Parameter validation in yielding methods should be wrapped
# https://rules.sonarsource.com/csharp/RSPEC-4456
#
# This is a duplicate of MA0050.
dotnet_diagnostic.S4456.severity = none
# S4487: Unread "private" fields should be removed
# https://rules.sonarsource.com/csharp/RSPEC-4487
#
# This is a duplicate of IDE0052.
dotnet_diagnostic.S4487.severity = none
# S4581: "new Guid()" should not be used
# https://rules.sonarsource.com/csharp/RSPEC-4581
#
# This is a partial duplicate of MA0067, and we do not want to report the use of 'default' for a Guid as error.
dotnet_diagnostic.S4581.severity = none
#### StyleCop rules ####
# SA1003: Symbols must be spaced correctly
#
# When enabled, a diagnostic is produced when there's a space after a cast.
# For example:
# var x = (int) z;
dotnet_diagnostic.SA1003.severity = none
# SA1008: Opening parenthesis should not be preceded by a space
#
# When enabled, a diagnostic is produce when a cast precedes braces.
# For example:
# (long) (a * b)
dotnet_diagnostic.SA1008.severity = none
# SA1009: Closing parenthesis should not be followed by a space
#
# When enabled, a diagnostic is produced when there's a space after a cast.
# For example:
# var x = (int) z;
dotnet_diagnostic.SA1009.severity = none
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none
# SA1116: Split parameters must start on line after declaration
#
# When enabled, a diagnostic is produced when the first parameter is on the same line as the method or constructor.
# For example:
# arrayBuilder.Add(new StatisticsCallInfo(callsByType.Key,
# callsForType.Count);
dotnet_diagnostic.SA1116.severity = none
# SA1200: Using directives must be placed correctly
#
# This is already verified by the .NET compiler platform analyzers (csharp_using_directive_placement option and IDE0065 rule).
dotnet_diagnostic.SA1200.severity = none
# SA1201: Elements must appear in the correct order
dotnet_diagnostic.SA1201.severity = none
# SA1206: Modifiers are not ordered
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1206.md
#
# This is a duplicate of IDE0036, except that it cannot be configured and expects the required modifier to be before the
# accessibility modifier.
dotnet_diagnostic.SA1206.severity = none
# SA1309: Field names must not begin with underscore
dotnet_diagnostic.SA1309.severity = none
# SA1405: Debug.Assert should provide message text
#
# To be discussed if we want to enable this.
dotnet_diagnostic.SA1405.severity = none
# SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none
# SA1503: Braces should not be omitted
#
# This is a duplicate of IDE0011.
dotnet_diagnostic.SA1503.severity = none
# SA1516: Elements must be separated by blank line
#
# When enabled, a diagnostic is produced for properties with both a get and set accessor.
# For example:
# public bool EnableStatistics
# {
# get
# {
# return _enableStatistics;
# }
# set
# {
# _enableStatistics = value;
# }
# }
dotnet_diagnostic.SA1516.severity = none
# SA1520: Use braces consistently
#
# Since we always require braces (configured via csharp_prefer_braces and reported as IDE0011), it does not make sense to check if braces
# are used consistently.
dotnet_diagnostic.SA1520.severity = none
# SA1633: File must have header
#
# We do not use file headers.
dotnet_diagnostic.SA1633.severity = none
# SA1648: <inheritdoc> must be used with inheriting class
#
# This rule is disabled by default, hence we need to explicitly enable it.
dotnet_diagnostic.SA1648.severity = error
# SX1101: Do not prefix local members with 'this.'
#
# This rule is disabled by default, hence we need to explicitly enable it.
dotnet_diagnostic.SX1101.severity = error
# SX1309: Field names must begin with underscore
#
# This rule is disabled by default, hence we need to explicitly enable it.
dotnet_diagnostic.SX1309.severity = error
# SX1309S: Static field names must begin with underscore
#
# This rule is disabled by default, hence we need to explicitly enable it.
dotnet_diagnostic.SX1309S.severity = error
#### Meziantou.Analyzer rules ####
# MA0002: Use an overload that has a IEqualityComparer<string> or IComparer<string> parameter
#
# In .NET (Core) there have been quite some optimizations for EqualityComparer<T>.Default (eg. https://github.com/dotnet/coreclr/pull/14125)
# and Comparer<T>.Default (eg. https://github.com/dotnet/runtime/pull/48160).
#
# We'll have to verify impact on performance before we decide to use specific comparers (eg. StringComparer.InvariantCultureIgnoreCase).
dotnet_diagnostic.MA0002.severity = none
# MA0006: Use string.Equals instead of Equals operator
#
# We almost always want ordinal comparison, and using the explicit overload adds a little overhead
# and is more chatty.
dotnet_diagnostic.MA0006.severity = none
# MA0007: Add a comma after the last value
#
# We do not add a comma after the last value in multi-line initializers.
# For example:
# public enum Sex
# {
# Male = 1,
# Female = 2 // No comma here
# }
#
# Note:
# This is a duplicate of SA1413.
dotnet_diagnostic.MA0007.severity = none
# MA0009: Add regex evaluation timeout
#
# We do not see a need guard our regex's against a DOS attack.
dotnet_diagnostic.MA0009.severity = none
# MA0011: IFormatProvider is missing
#
# Also report diagnostic in ToString(...) methods
MA0011.exclude_tostring_methods = false
# MA0012: Do not raise reserved exception type
#
# This is a duplicate of CA2201.
dotnet_diagnostic.MA0012.severity = none
# MA0014: Do not raise System.ApplicationException type
#
# This is a duplicate of CA2201.
dotnet_diagnostic.MA0014.severity = none
# MA0016: Prefer returning collection abstraction instead of implementation
#
# This is a duplicate of CA1002.
dotnet_diagnostic.MA0016.severity = none
# MA0018: Do not declare static members on generic types
#
# This is a duplicate of CA1000.
dotnet_diagnostic.MA0018.severity = none
# MA0021: Use StringComparer.GetHashCode instead of string.GetHashCode
#
# No strong need for this, and may negatively affect performance.
dotnet_diagnostic.MA0021.severity = none
# MA0031: Optimize Enumerable.Count() usage
# https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md
#
# The proposed code is less readable.
#
# For example:
#
# the following code fragment:
# enumerable.Count() > 10;
#
# would become:
# enumerable.Skip(10).Any();
dotnet_diagnostic.MA0031.severity = none
# MA0036: Make class static
#
# This is a partial duplicate of CA1052.
dotnet_diagnostic.MA0036.severity = none
# MA0038: Make method static
#
# This is a partial duplicate of, and deprecated in favor of, CA1822.
dotnet_diagnostic.MA0038.severity = none
# MA0041: Make property static
#
# This is a partial duplicate of, and deprecated in favor of, CA1822.
dotnet_diagnostic.MA0041.severity = none
# MA0048: File name must match type name
#
# This is a duplicate of SA1649.
dotnet_diagnostic.MA0048.severity = none
# MA0049: Type name should not match containing namespace
#
# This is a duplicate of CA1724
dotnet_diagnostic.MA0049.severity = none
# MA0051: Method is too long
#
# We do not want to limit the number of lines or statements per method.
dotnet_diagnostic.MA0051.severity = none
# MA0053: Make class sealed
#
# Also report diagnostic for public types.
MA0053.public_class_should_be_sealed = true
# MA0053: Make class sealed
#
# Also report diagnostic for types that derive from System.Exception.
MA0053.exceptions_should_be_sealed = true
# MA0053: Make class sealed
#
# Also report diagnostic for types that define (new) virtual members.
MA0053.class_with_virtual_member_shoud_be_sealed = true
# MA0112: Use 'Count > 0' instead of 'Any()'
#
# This rule is disabled by default, hence we need to explicitly enable it.
dotnet_diagnostic.MA0112.severity = error
#### .NET Compiler Platform code quality rules ####
# CA1002: Do not expose generic lists
#
# For performance reasons - to avoid interface dispatch - we expose generic lists
# instead of a base class or interface.
dotnet_diagnostic.CA1002.severity = none
# CA1008: Enums should have zero value
#
# TODO: To be discussed. Having a zero value offers a performance advantage.
dotnet_diagnostic.CA1008.severity = none
# CA1014: Mark assemblies with CLSCompliantAttribute
#
# This rule is disabled by default, hence we need to explicitly enable it.
#
# Even when enabled, this diagnostic does not appear to be reported for assemblies without CLSCompliantAttribute.
# We reported this issue as https://github.com/dotnet/roslyn-analyzers/issues/6563.
dotnet_diagnostic.CA1014.severity = error
# CA1051: Do not declare visible instance fields
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1051
#
# This is a duplicate of S1104 and SA1401.
dotnet_diagnostic.CA1051.severity = none
# CA1052: Static holder types should be Static or NotInheritable
#
# By default, this diagnostic is only reported for public types.
dotnet_code_quality.CA1052.api_surface = all
# CA1303: Do not pass literals as localized parameters
#
# We don't care about localization.
dotnet_diagnostic.CA1303.severity = none
# CA1305: Specify IFormatProvider
#
# This is a an equivalent of MA0011, except that it does not report a diagnostic for the use of
# DateTime.TryParse(string s, out DateTime result).
#
# Submitted https://github.com/dotnet/roslyn-analyzers/issues/6096 to fix CA1305.
dotnet_diagnostic.CA1305.severity = none
# CA1510: Use ArgumentNullException throw helper
#
# This is only available in .NET 6.0 and higher. We'd need to use conditional compilation to only
# use these throw helper when targeting a framework that supports it.
dotnet_diagnostic.CA1510.severity = none
# CA1725: Parameter names should match base declaration
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1725
#
# This is a duplicate of S927, but contains at least one bug:
# https://github.com/dotnet/roslyn-analyzers/issues/6461
#
# Since we do not enable any of the Sonar rules by default, we'll leave CA1725 enabled.
dotnet_diagnostic.CA1725.severity = error
# CA1819: Properties should not return arrays
#
# Arrays offer better performance than collections.
dotnet_diagnostic.CA1819.severity = none
# CA1828: Mark members as static
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
#
# Documentation does not mention which API surface(s) this rule runs on, so we explictly configure it.
dotnet_code_quality.CA1828.api_surface = all
# CA1852: Seal internal types
#
# Similar to MA0053, but does not support public types and types that define (new) virtual members.
dotnet_diagnostic.CA1852.severity = none
# CA1859: Change return type for improved performance
#
# By default, this diagnostic is only reported for private members.
dotnet_code_quality.CA1859.api_surface = all
# CA2208: Instantiate argument exceptions correctly
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2208
#
# This is similar to, but less powerful than, MA0015.
dotnet_diagnostic.CA2208.severity = none
#### Roslyn IDE analyser rules ####
# IDE0032: Use auto-implemented property
#
# For performance reasons, we do not always want to enforce the use of
# auto-implemented properties.
dotnet_diagnostic.IDE0032.severity = suggestion
# IDE0045: Use conditional expression for assignment
#
# This does not always result in cleaner/clearer code.
dotnet_diagnostic.IDE0045.severity = none
# IDE0046: Use conditional expression for return
#
# Using a conditional expression is not always a clear win for readability.
#
# Configured using 'dotnet_style_prefer_conditional_expression_over_return'
dotnet_diagnostic.IDE0046.severity = suggestion
# IDE0047: Remove unnecessary parentheses
#
# Removing "unnecessary" parentheses is not always a clear win for readability.
dotnet_diagnostic.IDE0047.severity = suggestion
# IDE0055: Fix formatting
#
# When enabled, diagnostics are reported for indented object initializers.
# For example:
# _content = new Person
# {
# Name = "\u13AAlarm"
# };
#
# There are no settings to configure this correctly, unless https://github.com/dotnet/roslyn/issues/63256 (or similar) is ever implemented.
dotnet_diagnostic.IDE0055.severity = none
# IDE0130: Namespace does not match folder structure
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130
#
# TODO: Remove when https://github.com/sshnet/SSH.NET/issues/1129 is fixed
dotnet_diagnostic.IDE0130.severity = none
# IDE0270: Null check can be simplified
#
# var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id);
# if (inputPath is null)
# {
# throw new PcsException($"Path id ({updatedPath.id}) unknown in PCS for dossier id {dossierFromTs.dossier.id}", updatedPath.id);
# }
#
# We do not want to modify the code using a null coalescing operator:
#
# var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id) ?? throw new PcsException($"Path id ({updatedPath.id}) unknown in PCS for dossier id {dossierFromTs.dossier.id}", updatedPath.id);
dotnet_diagnostic.IDE0270.severity = none
#### .NET Compiler Platform code style rules ####
### Language rules ###
## Modifier preferences
dotnet_style_require_accessibility_modifiers = true
dotnet_style_readonly_field = true
csharp_prefer_static_local_function = true
## Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
# Expression-level preferences
dotnet_style_object_initializer = true
csharp_style_inlined_variable_declaration = true
dotnet_style_collection_initializer = true
dotnet_style_prefer_auto_properties = true
dotnet_style_explicit_tuple_names = true
csharp_prefer_simple_default_expression = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_deconstructed_variable_declaration = false
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_compound_assignment = true
csharp_style_prefer_index_operator = false
csharp_style_prefer_range_operator = false
dotnet_style_prefer_simplified_interpolation = false
dotnet_style_prefer_simplified_boolean_expressions = true
csharp_style_implicit_object_creation_when_type_is_apparent = false
csharp_style_prefer_tuple_swap = false
# Namespace declaration preferences
csharp_style_namespace_declarations = block_scoped
# Null-checking preferences
csharp_style_throw_expression = false
dotnet_style_coalesce_expression = true
dotnet_style_null_propagation = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_conditional_delegate_call = true
# 'var' preferences
csharp_style_var_for_built_in_types = true
csharp_style_var_when_type_is_apparent = true
csharp_style_var_elsewhere = true
# Expression-bodies members
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = false
csharp_style_expression_bodied_indexers = false
csharp_style_expression_bodied_accessors = false
csharp_style_expression_bodied_lambdas = false
csharp_style_expression_bodied_local_functions = false
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_switch_expression = false
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_extended_property_pattern = true
# Code block preferences
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = false
# Using directive preferences
csharp_using_directive_placement = outside_namespace
# Namespace naming preferences
dotnet_style_namespace_match_folder = true
# Undocumented preferences
csharp_style_prefer_method_group_conversion = false
csharp_style_prefer_top_level_statements = false
### Formatting rules ###
## .NET formatting options ##
# Using directive options
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
## C# formatting options ##
# New-line options
# TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
#csharp_new_line_before_open_brace = accessors, anonymous_methods, anonymous_types, control_blocks, events, indexers, lambdas, local_functions, methods, object_collection_array_initializers, properties, types
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
# Enabling this setting breaks Resharper formatting for an enum field reference that is
# deeply nested in an object initializer.
#
# For an example, see TDataExchangeGeneralEnricher_CernInfrastructureObstruction.
#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 options
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_indent_block_contents = true
# TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
#csharp_indent_braces = false
# TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
#csharp_indent_case_contents_when_block = true
# Spacing options
csharp_space_after_cast = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_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_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_after_comma = true
csharp_space_before_comma = false
csharp_space_after_dot = false
csharp_space_before_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false
# Wrap options
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
### Naming styles ###
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = error
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = error
dotnet_naming_rule.private_static_readonly_fields_pascal_case.symbols = private_static_readonly_fields
dotnet_naming_rule.private_static_readonly_fields_pascal_case.style = pascal_case
dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = error
dotnet_naming_rule.private_const_fields_pascal_case.symbols = private_const_fields
dotnet_naming_rule.private_const_fields_pascal_case.style = pascal_case
dotnet_naming_rule.private_const_fields_pascal_case.severity = error
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = *
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = *
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = *
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.required_modifiers =
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static
dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly
dotnet_naming_symbols.private_const_fields.applicable_kinds = field
dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_const_fields.required_modifiers = const
# Naming styles
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.camel_case_begins_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_case
#### .NET Compiler Platform general options ####
# Change the default rule severity for all analyzer rules that are enabled by default
dotnet_analyzer_diagnostic.severity = error
#### .NET Compiler Platform code refactoring rules ####
dotnet_style_operator_placement_when_wrapping = end_of_line
#### ReSharper code style for C# ####
## Blank Lines
resharper_csharp_blank_lines_around_region = 1
resharper_csharp_blank_lines_inside_region = 1
resharper_csharp_blank_lines_before_single_line_comment = 1
resharper_csharp_keep_blank_lines_in_declarations = 1
resharper_csharp_remove_blank_lines_near_braces_in_declarations = true
resharper_csharp_blank_lines_after_start_comment = 1
resharper_csharp_blank_lines_between_using_groups = 1
resharper_csharp_blank_lines_after_using_list = 1
resharper_csharp_blank_lines_around_namespace = 1
resharper_csharp_blank_lines_inside_namespace = 0
resharper_csharp_blank_lines_after_file_scoped_namespace_directive = 1
resharper_csharp_blank_lines_around_type = 1
resharper_csharp_blank_lines_around_single_line_type = 1
resharper_csharp_blank_lines_inside_type = 0
resharper_csharp_blank_lines_around_field = 0
resharper_csharp_blank_lines_around_single_line_field = 0
resharper_csharp_blank_lines_around_property = 1
resharper_csharp_blank_lines_around_single_line_property = 1
resharper_csharp_blank_lines_around_auto_property = 1
resharper_csharp_blank_lines_around_single_line_auto_property = 1
resharper_csharp_blank_lines_around_accessor = 0
resharper_csharp_blank_lines_around_single_line_accessor = 0
resharper_csharp_blank_lines_around_invocable = 1
resharper_csharp_blank_lines_around_single_line_invocable = 1
resharper_csharp_keep_blank_lines_in_code = 1
resharper_csharp_remove_blank_lines_near_braces_in_code = true
resharper_csharp_blank_lines_around_local_method = 1
resharper_csharp_blank_lines_around_single_line_local_method = 1
resharper_csharp_blank_lines_before_control_transfer_statements = 0
resharper_csharp_blank_lines_after_control_transfer_statements = 0
resharper_csharp_blank_lines_before_block_statements = 0
resharper_csharp_blank_lines_after_block_statements = 1
resharper_csharp_blank_lines_before_multiline_statements = 0
resharper_csharp_blank_lines_after_multiline_statements = 0
resharper_csharp_blank_lines_around_block_case_section = 0
resharper_csharp_blank_lines_around_multiline_case_section = 0
resharper_csharp_blank_lines_before_case = 0
resharper_csharp_blank_lines_after_case = 0
## Braces Layout
resharper_csharp_type_declaration_braces = next_line
resharper_csharp_indent_inside_namespace = true
resharper_csharp_invocable_declaration_braces = next_line
resharper_csharp_anonymous_method_declaration_braces = next_line_shifted_2
resharper_csharp_accessor_owner_declaration_braces = next_line
resharper_csharp_accessor_declaration_braces = next_line
resharper_csharp_case_block_braces = next_line_shifted_2
resharper_csharp_initializer_braces = next_line_shifted_2
resharper_csharp_use_continuous_indent_inside_initializer_braces = true
resharper_csharp_other_braces = next_line
resharper_csharp_allow_comment_after_lbrace = false
resharper_csharp_empty_block_style = multiline
## Syntax Style
# 'var' usage in declarations
resharper_csharp_for_built_in_types = use_var
resharper_csharp_for_simple_types = use_var
resharper_csharp_for_other_types = use_var
# Instance members qualification
resharper_csharp_instance_members_qualify_members = none
resharper_csharp_instance_members_qualify_declared_in = base_class
# Static members qualification
resharper_csharp_static_members_qualify_with = declared_type
resharper_csharp_static_members_qualify_members = none
# Built-in types
resharper_csharp_builtin_type_reference_style = use_keyword
resharper_csharp_builtin_type_reference_for_member_access_style = use_keyword
# Reference qualification and 'using' directives
resharper_csharp_prefer_qualified_reference = false
resharper_csharp_add_imports_to_deepest_scope = false
resharper_csharp_qualified_using_at_nested_scope = false
resharper_csharp_allow_alias = true
resharper_csharp_can_use_global_alias = true
# Modifiers
resharper_csharp_default_private_modifier = explicit
resharper_csharp_default_internal_modifier = explicit
resharper_csharp_modifiers_order = public private protected internal file static extern new virtual abstract sealed override readonly unsafe required volatile async
# Braces
resharper_csharp_braces_for_ifelse = required
resharper_csharp_braces_for_for = required
resharper_csharp_braces_for_foreach = required
resharper_csharp_braces_for_while = required
resharper_csharp_braces_for_dowhile = required
resharper_csharp_braces_for_using = required
resharper_csharp_braces_for_lock = required
resharper_csharp_braces_for_fixed = required
resharper_csharp_braces_redundant = false
# Code body
resharper_csharp_method_or_operator_body = block_body
resharper_csharp_local_function_body = block_body
resharper_csharp_constructor_or_destructor_body = block_body
resharper_csharp_accessor_owner_body = accessors_with_block_body
resharper_csharp_namespace_body = block_scoped
resharper_csharp_use_heuristics_for_body_style = false
# Trailing comma
resharper_csharp_trailing_comma_in_multiline_lists = false
resharper_csharp_trailing_comma_in_singleline_lists = false
# Object creation
resharper_csharp_object_creation_when_type_evident = explicitly_typed
resharper_csharp_object_creation_when_type_not_evident = explicitly_typed
# Default value
resharper_csharp_default_value_when_type_evident = default_literal
resharper_csharp_default_value_when_type_not_evident = default_literal
## Tabs, Indents, Alignment
# Nested statements
resharper_csharp_indent_nested_usings_stmt = false
resharper_csharp_indent_nested_fixed_stmt = false
resharper_csharp_indent_nested_lock_stmt = false
resharper_csharp_indent_nested_for_stmt = true
resharper_csharp_indent_nested_foreach_stmt = true
resharper_csharp_indent_nested_while_stmt = true
# Parenthesis
resharper_csharp_use_continuous_indent_inside_parens = true
resharper_csharp_indent_method_decl_pars = outside_and_inside
resharper_csharp_indent_invocation_pars = outside_and_inside
resharper_csharp_indent_statement_pars = outside_and_inside
resharper_csharp_indent_typeparam_angles = outside_and_inside
resharper_csharp_indent_typearg_angles = outside_and_inside
resharper_csharp_indent_pars = outside_and_inside
# Preprocessor directives
resharper_csharp_indent_preprocessor_if = no_indent
resharper_csharp_indent_preprocessor_region = usual_indent
resharper_csharp_indent_preprocessor_other = no_indent
# Other indents
resharper_indent_switch_labels = true
resharper_csharp_outdent_statement_labels = true
resharper_csharp_indent_type_constraints = true
resharper_csharp_stick_comment = false
resharper_csharp_place_comments_at_first_column = false
resharper_csharp_use_indent_from_previous_element = true
resharper_csharp_indent_braces_inside_statement_conditions = true
# Align multiline constructs
resharper_csharp_alignment_tab_fill_style = use_spaces
resharper_csharp_allow_far_alignment = true
resharper_csharp_align_multiline_parameter = true
resharper_csharp_align_multiline_extends_list = true
resharper_csharp_align_linq_query = true
resharper_csharp_align_multiline_binary_expressions_chain = true