-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.editorconfig
More file actions
533 lines (447 loc) · 28.9 KB
/
.editorconfig
File metadata and controls
533 lines (447 loc) · 28.9 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
# EditorConfig is awesome: https://EditorConfig.org
# Top-most EditorConfig file
root = true
# Universal EOL and charset behavior
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# Indentation and spacing
[*.cs]
indent_style = space
indent_size = 4
tab_width = 4
# Newline preferences
dotnet_style_new_line_before_open_brace = all
dotnet_style_new_line_before_else = true
dotnet_style_new_line_before_catch = true
dotnet_style_new_line_before_finally = true
dotnet_style_new_line_before_members_in_object_initializers = true
dotnet_style_new_line_before_members_in_anonymous_types = true
dotnet_style_new_line_between_query_expression_clauses = true
# Code style settings
# this. and Me. preferences
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning
# Language keywords vs framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Modifier preferences
dotnet_style_require_accessibility_modifiers = always:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
csharp_style_throw_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
# Unnecessary code suggestions
dotnet_remove_unnecessary_casts = true:warning
dotnet_style_prefer_readonly_struct = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
# Naming conventions
# Rules are specified using the following format:
# dotnet_naming_rule.<naming_rule_name>.severity = <severity>
# dotnet_naming_rule.<naming_rule_name>.symbols = <symbol_kind_group_name>
# dotnet_naming_rule.<naming_rule_name>.style = <naming_style_name>
# Symbol kind group names:
# Namespace, Class, Struct, Enum, Interface, Delegate, Event, Method, Property, Field,
# Parameter, TypeParameter, Local, LocalFunction
# Naming style names:
# PascalCase, CamelCase, FirstUpper, AllUpper, AllLower
# Interfaces should start with 'I' (PascalCase)
dotnet_naming_rule.interface_should_be_pascal_case_with_i.symbols = Interface
dotnet_naming_rule.interface_should_be_pascal_case_with_i.style = PascalCaseWithI
dotnet_naming_rule.interface_should_be_pascal_case_with_i.severity = suggestion
dotnet_naming_symbols.Interface.applicable_kinds = interface
dotnet_naming_style.PascalCaseWithI.required_prefix = I
dotnet_naming_style.PascalCaseWithI.capitalization = pascal_case
# Async methods should end with 'Async'
dotnet_naming_rule.async_methods_should_end_with_async.symbols = Method
dotnet_naming_rule.async_methods_should_end_with_async.style = EndsWithAsync
dotnet_naming_rule.async_methods_should_end_with_async.severity = suggestion
dotnet_naming_symbols.Method.applicable_kinds = method
dotnet_naming_style.EndsWithAsync.required_suffix = Async
dotnet_naming_style.EndsWithAsync.capitalization = pascal_case
# Public members should be PascalCase
dotnet_naming_rule.public_members_should_be_pascal_case.symbols = PublicMembers
dotnet_naming_rule.public_members_should_be_pascal_case.style = PascalCase
dotnet_naming_rule.public_members_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.PublicMembers.applicable_kinds = class, struct, enum, property, method, event, delegate
dotnet_naming_symbols.PublicMembers.applicable_accessibilities = public, internal, protected, protected_internal
dotnet_naming_style.PascalCase.capitalization = pascal_case
# Non-public fields should be camelCase and start with _
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.symbols = PrivateInstanceFields
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.style = CamelCaseWithUnderscore
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.severity = suggestion
dotnet_naming_symbols.PrivateInstanceFields.applicable_kinds = field
dotnet_naming_symbols.PrivateInstanceFields.applicable_accessibilities = private
dotnet_naming_symbols.PrivateInstanceFields.required_modifiers = instance # static fields are covered by another rule
dotnet_naming_style.CamelCaseWithUnderscore.required_prefix = _
dotnet_naming_style.CamelCaseWithUnderscore.capitalization = camel_case
# Static fields (public or non-public)
dotnet_naming_rule.static_fields_should_be_pascal_case.symbols = StaticFields
dotnet_naming_rule.static_fields_should_be_pascal_case.style = PascalCase
dotnet_naming_rule.static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.StaticFields.applicable_kinds = field
dotnet_naming_symbols.StaticFields.required_modifiers = static
# Constants should be PascalCase (or AllUpper if preferred, but PascalCase is common in .NET)
dotnet_naming_rule.constants_should_be_pascal_case.symbols = Constants
dotnet_naming_rule.constants_should_be_pascal_case.style = PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.Constants.applicable_kinds = field
dotnet_naming_symbols.Constants.required_modifiers = const
# Local variables should be camelCase
dotnet_naming_rule.locals_should_be_camel_case.symbols = Locals
dotnet_naming_rule.locals_should_be_camel_case.style = CamelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_symbols.Locals.applicable_kinds = local
dotnet_naming_style.CamelCase.capitalization = camel_case
# Parameters should be camelCase
dotnet_naming_rule.parameters_should_be_camel_case.symbols = Parameters
dotnet_naming_rule.parameters_should_be_camel_case.style = CamelCase
dotnet_naming_rule.parameters_should_be_camel_case.severity = suggestion
dotnet_naming_symbols.Parameters.applicable_kinds = parameter
dotnet_naming_style.CamelCase.capitalization = camel_case
# Type parameters should start with 'T' (PascalCase)
dotnet_naming_rule.type_parameters_should_be_pascal_case_with_t.symbols = TypeParameters
dotnet_naming_rule.type_parameters_should_be_pascal_case_with_t.style = PascalCaseWithT
dotnet_naming_rule.type_parameters_should_be_pascal_case_with_t.severity = suggestion
dotnet_naming_symbols.TypeParameters.applicable_kinds = type_parameter
dotnet_naming_style.PascalCaseWithT.required_prefix = T
dotnet_naming_style.PascalCaseWithT.capitalization = pascal_case
# Rules to encourage SOLID-like principles (limited by .editorconfig capabilities)
# These are more about code complexity and readability, which indirectly support SOLID.
# Avoid long lines (helps with readability)
max_line_length = 120:suggestion
# C# specific formatting options
csharp_preserve_single_line_blocks = false
csharp_preserve_single_line_statements = false
# Spacing options
csharp_space_after_cast = true
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 = false
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_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping and new lines
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
# Blank line preferences
csharp_blank_lines_around_accessor_blocks = 0
csharp_blank_lines_between_consecutive_braces = 0
csharp_blank_lines_between_imports = 1
csharp_blank_lines_between_members_in_anonymous_types = 0
csharp_blank_lines_between_members_in_object_initializers = 0
csharp_blank_lines_between_single_line_members = 1
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
# Expression-bodied members
csharp_style_expression_bodied_methods = when_on_single_line:warning
csharp_style_expression_bodied_constructors = when_on_single_line:warning
csharp_style_expression_bodied_operators = when_on_single_line:warning
csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_lambdas = true:warning
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
# var preferences - enforce explicit types to match SonarCloud
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning
csharp_style_var_elsewhere = false:warning
# Using directive preferences
csharp_using_directive_placement = outside_namespace:warning
dotnet_sort_system_directives_first = true
dotnet_diagnostic.IDE0005.severity = error
dotnet_diagnostic.CS8019.severity = error
# Collection expression preferences (C# 12+)
dotnet_diagnostic.IDE0300.severity = suggestion # Use collection expression for array
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
dotnet_diagnostic.IDE0305.severity = suggestion # Use collection expression for fluent
# WARNING ENFORCEMENT: Critical code quality rules are now errors
# Async/await patterns
dotnet_diagnostic.CS1998.severity = error # Async method without await
dotnet_diagnostic.S6966.severity = error # Use RunAsync instead of Run
# Exception handling
dotnet_diagnostic.S2139.severity = error # Log and handle or rethrow with context
# Code cleanup
dotnet_diagnostic.S125.severity = error # Remove commented out code
dotnet_diagnostic.S1172.severity = error # Remove unused method parameters
dotnet_diagnostic.S1481.severity = error # Remove unused local variables
dotnet_diagnostic.S4487.severity = error # Remove unused private fields
# Class design
dotnet_diagnostic.S1118.severity = error # Add protected constructor or static keyword
dotnet_diagnostic.S3260.severity = error # Mark private classes as sealed
dotnet_diagnostic.S2325.severity = error # Make methods static when possible
# URI and security
dotnet_diagnostic.S1075.severity = error # No hardcoded absolute paths or URIs
# Method complexity and length
dotnet_diagnostic.S3776.severity = error # Cognitive complexity limit
dotnet_diagnostic.S138.severity = error # Method length limit
# Logging
dotnet_diagnostic.S6677.severity = error # Unique message template placeholders
# Code block preferences
csharp_prefer_braces = true:warning
# XML Documentation Comments
# IDE0055: Fix formatting of XML documentation comments
dotnet_diagnostic.IDE0055.severity = suggestion
# IDE0072: Add missing cases to switch expression
dotnet_diagnostic.IDE0072.severity = warning
# IDE0073: Require file header
dotnet_diagnostic.IDE0073.severity = silent
# csharp_style_require_file_header_template = unset
# The following rules are examples of what might be used for complexity,
# but actual enforcement often needs dedicated analyzers.
# .editorconfig has limited direct support for "max method length" or "max class size".
# However, some Roslyn analyzers might be configurable via .editorconfig using their diagnostic IDs.
# Example: Potentially configure a Roslyn analyzer for complexity if its ID is known
# and it supports .editorconfig severity setting.
# dotnet_diagnostic.<AnalyzerRuleId>.severity = warning
# For instance, if there was an analyzer rule `MyCompany.CodeAnalysis.TooManyLinesInMethod`
# you might try:
# dotnet_diagnostic.MyCompany.CodeAnalysis.TooManyLinesInMethod.severity = warning
# dotnet_diagnostic.MyCompany.CodeAnalysis.TooManyLinesInMethod.max_lines = 100
# Similarly for class size:
# dotnet_diagnostic.MyCompany.CodeAnalysis.ClassTooLarge.severity = warning
# dotnet_diagnostic.MyCompany.CodeAnalysis.ClassTooLarge.max_lines = 500
# Since standard .editorconfig doesn't have these directly, these are placeholders.
# The primary way to enforce these types of rules is through Roslyn analyzers
# referenced in the project file, which then respect severity settings from .editorconfig.
# The `max_line_length` is a general setting that helps a bit.
# Roslynator rules fine-tuned for SOLID principles (severity set to warning, will be error due to TreatWarningsAsErrors=true)
# SRP & Complexity related
dotnet_diagnostic.RCS1208.severity = warning # Reduce 'if' nesting
dotnet_diagnostic.RCS1060.severity = warning # Declare each type in separate file
# Note: Direct method/class size rules are not easily available via Roslynator .editorconfig alone.
# OCP & DIP related (promoting abstractions, immutability)
dotnet_diagnostic.RCS1102.severity = warning # Make class static (if applicable, encourages utility classes over instantiable ones for stateless helpers)
dotnet_diagnostic.RCS1160.severity = warning # Abstract type should not have public constructors
dotnet_diagnostic.RCS1169.severity = warning # Make field read-only (where possible)
dotnet_diagnostic.RCS1170.severity = warning # Use read-only auto-implemented property (where possible)
dotnet_diagnostic.RCS1172.severity = warning # Use 'is' operator instead of 'as' operator (prompts review of type checking)
# ISP related
dotnet_diagnostic.RCS1213.severity = warning # Remove unused member declaration (can indicate fat interfaces/classes)
# General good practices supporting SOLID
dotnet_diagnostic.RCS1059.severity = warning # Avoid locking on publicly accessible instance
dotnet_diagnostic.RCS1075.severity = warning # Avoid empty catch clause that catches System.Exception or System.Object
dotnet_diagnostic.RCS1155.severity = warning # Use StringComparison when comparing strings
dotnet_diagnostic.RCS1210.severity = warning # Return completed task instead of returning null (for async methods)
dotnet_diagnostic.RCS1215.severity = warning # Expression is always equal to true/false
# End of Roslynator SOLID tuning
# SonarAnalyzer.CSharp rules for code metrics (severity set to warning, will be error due to TreatWarningsAsErrors=true)
# Cognitive Complexity of methods should not be too high
dotnet_diagnostic.S3776.severity = warning
# Methods should not have too many lines of code
dotnet_diagnostic.S138.severity = warning
# Files should not have too many lines of code
dotnet_diagnostic.S110.severity = warning
# Methods should not have too many parameters
dotnet_diagnostic.S107.severity = warning
# Control flow statements should not be nested too deeply
# dotnet_diagnostic.S121.severity = warning # Overridden below
# Disable S121 (SonarCloud: Add curly braces when block has one statement) globally
dotnet_diagnostic.S121.severity = none
# Classes should not be coupled to too many other classes
dotnet_diagnostic.S1699.severity = warning
# Inheritance tree of classes should not be too deep
dotnet_diagnostic.S1109.severity = warning
# Unused private members should be removed (helps with ISP and SRP)
dotnet_diagnostic.S1144.severity = warning
# Unused method parameters should be removed (supports SRP)
dotnet_diagnostic.S1066.severity = warning
# HTTP protocol security rule - use HTTPS instead of HTTP
dotnet_diagnostic.S5332.severity = warning
# Fields should be readonly where possible
dotnet_diagnostic.S2933.severity = warning
# End of SonarAnalyzer.CSharp metric rules
# Enable Sonar code analysis warnings locally to match SonarCloud
# Default severity for all Sonar rules not explicitly configured above
# This makes local builds show the same warnings as SonarCloud
# Set default severity to suggestion for most Sonar rules
# (Rules already configured above with error/warning severity remain unchanged)
# Disable rules that require massive refactoring or internationalization
dotnet_diagnostic.S4055.severity = none # Literals should not be passed as localized parameters
dotnet_diagnostic.S4056.severity = none # Use CultureInfo overloads
dotnet_diagnostic.S4058.severity = none # Use StringComparison overloads
dotnet_diagnostic.S1451.severity = none # Copyright/license headers
dotnet_diagnostic.S3257.severity = none # Declarations should be concise
dotnet_diagnostic.S4005.severity = none # URI arguments should not be strings
dotnet_diagnostic.S3994.severity = none # URI return values should not be strings
dotnet_diagnostic.S3995.severity = none # URI properties should not be strings
dotnet_diagnostic.S3996.severity = none # URI properties should not be strings
dotnet_diagnostic.S3997.severity = none # String URI overloads should call System.Uri overloads
dotnet_diagnostic.S3242.severity = none # Method parameters with base types
dotnet_diagnostic.S2360.severity = none # Optional parameters
dotnet_diagnostic.S4049.severity = none # Methods as properties
dotnet_diagnostic.S1309.severity = none # Track in-source suppressions
dotnet_diagnostic.S1135.severity = none # Track TODO tags
dotnet_diagnostic.S3217.severity = none # Track FIXME tags
dotnet_diagnostic.S3872.severity = none # Parameter names should match base declaration
# Enable important code quality and formatting rules as warnings
dotnet_diagnostic.S113.severity = warning # Files should contain empty newline at end
dotnet_diagnostic.S1128.severity = warning # Remove unused using directives
dotnet_diagnostic.S2148.severity = warning # Underscores should be used for readable numbers
dotnet_diagnostic.S3052.severity = warning # Remove redundant initializers
dotnet_diagnostic.S4041.severity = warning # Type names should not match namespaces
dotnet_diagnostic.S4004.severity = warning # Collection properties should be readonly
dotnet_diagnostic.S2931.severity = warning # Classes with IDisposable members should implement IDisposable
dotnet_diagnostic.S6605.severity = warning # Collection-specific Exists method should be used
dotnet_diagnostic.S6354.severity = warning # Use a testable time provider
dotnet_diagnostic.S6602.severity = warning # Find method should be used instead of FirstOrDefault
dotnet_diagnostic.S2302.severity = warning # nameof should be used
dotnet_diagnostic.S103.severity = warning # Lines should not be too long
dotnet_diagnostic.S104.severity = warning # Files should not have too many lines
dotnet_diagnostic.S131.severity = warning # Switch statements should end with default clause
dotnet_diagnostic.S1192.severity = warning # String literals should not be duplicated
dotnet_diagnostic.S4226.severity = warning # Extensions should be in separate namespaces
dotnet_diagnostic.S4040.severity = warning # Strings should be normalized to uppercase
# Enable Roslynator rules for better code organization
# RCS1060 is already set to warning in the config above
# SonarCloud additional rules to match reported issues
dotnet_diagnostic.S2436.severity = warning # Reduce the number of generic type parameters
dotnet_diagnostic.S2757.severity = warning # Logging templates should be constant
dotnet_diagnostic.S2325.severity = warning # Make methods static if possible
# Roslyn IDE rules for code quality
dotnet_diagnostic.IDE0040.severity = warning # Add accessibility modifiers
dotnet_diagnostic.IDE0044.severity = warning # Add readonly modifier
dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
dotnet_diagnostic.IDE0052.severity = warning # Remove unread private member
dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter
dotnet_diagnostic.IDE0079.severity = warning # Remove unnecessary suppression
dotnet_diagnostic.CA1822.severity = warning # Mark members as static
dotnet_diagnostic.CA1050.severity = warning # Make class sealed
dotnet_diagnostic.CA1070.severity = warning # Use 'System.ArgumentNullException.ThrowIfNull'
# Additional Roslyn/Sonar rules to match SonarCloud issues
dotnet_diagnostic.CS8618.severity = warning # Nullable reference type annotations
dotnet_diagnostic.CS8600.severity = warning # Converting null literal to non-nullable reference
dotnet_diagnostic.CS8602.severity = warning # Dereference of possibly null reference
dotnet_diagnostic.CS8604.severity = warning # Possible null reference argument
dotnet_diagnostic.IDE0007.severity = warning # Use 'var' instead of explicit type
dotnet_diagnostic.IDE0008.severity = warning # Use explicit type instead of 'var'
dotnet_diagnostic.IDE0011.severity = warning # Add braces
dotnet_diagnostic.IDE0058.severity = none # Expression value is never used (disabled for test files)
dotnet_diagnostic.IDE0059.severity = warning # Unnecessary assignment
dotnet_diagnostic.IDE0090.severity = warning # Use 'new(...)'
dotnet_diagnostic.IDE1005.severity = warning # Use conditional delegate call
dotnet_diagnostic.IDE0029.severity = warning # Use coalesce expression
dotnet_diagnostic.IDE0030.severity = warning # Use coalesce expression
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation
dotnet_diagnostic.IDE0045.severity = warning # Use conditional expression for assignment
dotnet_style_prefer_conditional_expression_over_return = false:warning
dotnet_diagnostic.IDE0046.severity = warning # Use conditional expression for return
dotnet_diagnostic.IDE0074.severity = warning # Use compound assignment
dotnet_diagnostic.IDE0075.severity = warning # Simplify conditional expression
dotnet_diagnostic.IDE0082.severity = warning # Convert 'typeof' to 'nameof'
dotnet_diagnostic.IDE0083.severity = warning # Use pattern matching
dotnet_diagnostic.IDE0180.severity = warning # Use tuple to swap values
dotnet_diagnostic.IDE0200.severity = warning # Remove unnecessary lambda expression
dotnet_diagnostic.IDE0220.severity = warning # Add explicit cast
dotnet_diagnostic.IDE0230.severity = warning # Use UTF-8 string literal
dotnet_diagnostic.IDE0240.severity = warning # Remove redundant nullable directive
dotnet_diagnostic.IDE0241.severity = warning # Remove unnecessary nullable directive
dotnet_diagnostic.IDE0251.severity = warning # Make member readonly
dotnet_diagnostic.IDE0290.severity = warning # Use primary constructor
dotnet_diagnostic.IDE0300.severity = warning # Use collection expression for array
dotnet_diagnostic.IDE0301.severity = warning # Use collection expression for empty
dotnet_diagnostic.IDE0302.severity = warning # Use collection expression for stackalloc
dotnet_diagnostic.IDE0303.severity = warning # Use collection expression for Create()
dotnet_diagnostic.IDE0304.severity = warning # Use collection expression for builder
dotnet_diagnostic.IDE0305.severity = warning # Use collection expression for fluent
# Roslynator rules for code quality
dotnet_diagnostic.RCS1001.severity = warning # Add braces to if-else
dotnet_diagnostic.RCS1003.severity = warning # Add braces to if-else
dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line
dotnet_diagnostic.RCS1037.severity = warning # Remove trailing whitespace
dotnet_diagnostic.RCS1049.severity = warning # Simplify boolean comparison
dotnet_diagnostic.RCS1050.severity = warning # Add argument list to object creation
dotnet_diagnostic.RCS1085.severity = warning # Use auto-implemented property
dotnet_diagnostic.RCS1163.severity = warning # Unused parameter
dotnet_diagnostic.RCS1164.severity = warning # Unused type parameter
dotnet_diagnostic.RCS1168.severity = warning # Parameter name differs from base
dotnet_diagnostic.RCS1175.severity = warning # Unused this parameter
dotnet_diagnostic.RCS1181.severity = warning # Convert comment to documentation comment
dotnet_diagnostic.RCS1186.severity = warning # Use RegexOptions.Compiled
dotnet_diagnostic.RCS1188.severity = warning # Remove redundant auto-property initialization
dotnet_diagnostic.RCS1189.severity = warning # Add or remove region name
dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal
dotnet_diagnostic.RCS1197.severity = warning # Optimize StringBuilder.Append/AppendLine call
dotnet_diagnostic.RCS1201.severity = warning # Use method chaining
dotnet_diagnostic.RCS1202.severity = warning # Avoid NullReferenceException
dotnet_diagnostic.RCS1207.severity = warning # Convert anonymous function to method group
dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause
dotnet_diagnostic.RCS1212.severity = warning # Remove redundant assignment
dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string
dotnet_diagnostic.RCS1217.severity = warning # Convert interpolated string to concatenation
dotnet_diagnostic.RCS1224.severity = warning # Make method an extension method
dotnet_diagnostic.RCS1226.severity = warning # Add paragraph to documentation comment
dotnet_diagnostic.RCS1228.severity = warning # Unused element in documentation comment
dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment
dotnet_diagnostic.RCS1234.severity = warning # Duplicate enum value
# Sonar logging rules
dotnet_diagnostic.S2190.severity = warning # Recursion
dotnet_diagnostic.S2551.severity = warning # Shared resources should not be used for locking
dotnet_diagnostic.S2583.severity = warning # Conditionally executed code should be reachable
dotnet_diagnostic.S2589.severity = warning # Boolean expressions should not be gratuitous
dotnet_diagnostic.S2681.severity = warning # Multiline blocks should be enclosed in braces
dotnet_diagnostic.S2701.severity = warning # Literal suffixes should be upper case
dotnet_diagnostic.S2737.severity = warning # Catch clauses should do more than rethrow
dotnet_diagnostic.S2952.severity = warning # Classes should dispose of members
dotnet_diagnostic.S3010.severity = warning # Static fields should not be updated in methods
dotnet_diagnostic.S3168.severity = warning # Async methods should not return void
dotnet_diagnostic.S3216.severity = warning # ConfigureAwait(false) should be used
dotnet_diagnostic.S3220.severity = warning # Method calls should not resolve ambiguously
dotnet_diagnostic.S3358.severity = warning # Extract ternary operation from expression
dotnet_diagnostic.S3400.severity = warning # Methods should not return constants
dotnet_diagnostic.S3440.severity = warning # Variables should not be checked against the values they're assigned
dotnet_diagnostic.S3441.severity = warning # Redundant property names
dotnet_diagnostic.S3442.severity = warning # Abstract classes should not have public constructors
dotnet_diagnostic.S3443.severity = warning # Types should not extend outdated base types
dotnet_diagnostic.S3444.severity = warning # Interfaces should not simply inherit from base
dotnet_diagnostic.S3445.severity = warning # Exceptions should not be explicitly rethrown
dotnet_diagnostic.S3453.severity = warning # Classes should not have only private constructors
dotnet_diagnostic.S3872.severity = warning # Parameter names should match original
dotnet_diagnostic.S3881.severity = warning # Implement IDisposable correctly
dotnet_diagnostic.S3898.severity = warning # Value types should implement equality
dotnet_diagnostic.S3900.severity = warning # Arguments should match parameters
dotnet_diagnostic.S3903.severity = warning # Types should be defined in named namespaces
dotnet_diagnostic.S3925.severity = warning # Serialization event handlers should be implemented correctly
dotnet_diagnostic.S3927.severity = warning # Serialization event handlers should have correct signature
dotnet_diagnostic.S3928.severity = warning # Argument types should match parameters
dotnet_diagnostic.S4004.severity = warning # Collection properties should be readonly
dotnet_diagnostic.S4016.severity = warning # Enumeration members should not be named Reserved
dotnet_diagnostic.S4023.severity = warning # Interfaces should not be empty
dotnet_diagnostic.S4025.severity = warning # Child class fields shadowing parent fields
dotnet_diagnostic.S4035.severity = warning # Classes implementing IEquatable should override Equals
dotnet_diagnostic.S4070.severity = warning # Non-flags enums should not be marked with FlagsAttribute
# SonarCloud specific logging rules to match reported issues
dotnet_diagnostic.S2629.severity = warning # Logging templates should be constant
dotnet_diagnostic.S2589.severity = warning # Boolean expressions should not be gratuitous