|
1 | 1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories
|
2 | 2 | root = true
|
3 | 3 |
|
4 |
| -# C# files |
5 |
| -[*.cs] |
| 4 | +# All files |
| 5 | +[*] |
6 | 6 |
|
7 | 7 | #### Core EditorConfig Options ####
|
8 | 8 |
|
9 | 9 | # Encoding
|
10 | 10 | charset = utf-8
|
11 | 11 |
|
12 | 12 | # Indentation and spacing
|
| 13 | +tab_width = 4 |
13 | 14 | indent_size = 4
|
14 | 15 | indent_style = space
|
15 |
| -tab_width = 4 |
16 | 16 |
|
17 | 17 | # New line preferences
|
18 |
| -end_of_line = crlf |
| 18 | +end_of_line = unset |
19 | 19 | insert_final_newline = false
|
20 | 20 |
|
| 21 | +#### Build files #### |
| 22 | + |
| 23 | +# Solution files |
| 24 | +[*.{sln,slnx}] |
| 25 | +tab_width = 4 |
| 26 | +indent_size = 4 |
| 27 | +indent_style = tab |
| 28 | + |
| 29 | +# Configuration files |
| 30 | +[*.{json,xml,yml,config,runsettings}] |
| 31 | +indent_size = 2 |
| 32 | + |
| 33 | +# MSBuild files |
| 34 | +[*.{slnf,props,targets,projitems,csproj,shproj}] |
| 35 | +indent_size = 2 |
| 36 | + |
| 37 | +#### Source files #### |
| 38 | + |
| 39 | +# Markdown files |
| 40 | +[*.md] |
| 41 | +indent_size = 2 |
| 42 | +insert_final_newline = true |
| 43 | + |
| 44 | +# C# files |
| 45 | +[*.cs] |
| 46 | + |
21 | 47 | #### .NET Coding Conventions ####
|
22 | 48 |
|
23 | 49 | # this. and Me. preferences
|
@@ -138,8 +164,8 @@ csharp_space_between_square_brackets = false
|
138 | 164 | csharp_preserve_single_line_blocks = true
|
139 | 165 | csharp_preserve_single_line_statements = true
|
140 | 166 |
|
141 |
| - |
142 | 167 | # Naming Symbols
|
| 168 | + |
143 | 169 | # constant_fields - Define constant fields
|
144 | 170 | dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
145 | 171 | dotnet_naming_symbols.constant_fields.required_modifiers = const
|
@@ -171,6 +197,7 @@ dotnet_naming_symbols.non_interface_types.applicable_kinds
|
171 | 197 | dotnet_naming_symbols.interface_types.applicable_kinds = interface
|
172 | 198 |
|
173 | 199 | # Naming Styles
|
| 200 | + |
174 | 201 | # camel_case - Define the camelCase style
|
175 | 202 | dotnet_naming_style.camel_case.capitalization = camel_case
|
176 | 203 | # pascal_case - Define the Pascal_case style
|
@@ -239,15 +266,8 @@ dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style
|
239 | 266 | dotnet_naming_style.prefix_private_field_with_underscore.capitalization = camel_case
|
240 | 267 | dotnet_naming_style.prefix_private_field_with_underscore.required_prefix = _
|
241 | 268 |
|
242 |
| -# Code files |
| 269 | +# .NET Code Analysis |
243 | 270 |
|
244 |
| -# SA1009: Closing parenthesis should be spaced correctly |
245 |
| -# Needed for null forgiving operator after functions, "foo()!" |
246 |
| -dotnet_diagnostic.SA1009.severity = none |
247 |
| - |
248 |
| -[*.{cs,vb}] |
249 |
| - |
250 |
| -# Migrate back from old Toolkit.ruleset |
251 | 271 | dotnet_diagnostic.CA1001.severity = warning
|
252 | 272 | dotnet_diagnostic.CA1009.severity = warning
|
253 | 273 | dotnet_diagnostic.CA1016.severity = warning
|
@@ -310,24 +330,43 @@ dotnet_diagnostic.CA2238.severity = warning
|
310 | 330 | dotnet_diagnostic.CA2240.severity = warning
|
311 | 331 | dotnet_diagnostic.CA2241.severity = warning
|
312 | 332 | dotnet_diagnostic.CA2242.severity = warning
|
| 333 | + |
| 334 | +# StyleCop Code Analysis |
| 335 | + |
| 336 | +# Closing parenthesis should be spaced correctly: "foo()!" |
| 337 | +dotnet_diagnostic.SA1009.severity = none |
| 338 | + |
| 339 | +# Hide warnings when using the new() expression from C# 9. |
| 340 | +dotnet_diagnostic.SA1000.severity = none |
| 341 | + |
313 | 342 | dotnet_diagnostic.SA1011.severity = none
|
314 | 343 | dotnet_diagnostic.SA1101.severity = none
|
| 344 | + |
| 345 | +# Hide warnings when accessing properties without "this". |
| 346 | +dotnet_diagnostic.SA1101.severity = none |
315 | 347 | dotnet_diagnostic.SA1118.severity = none
|
316 | 348 | dotnet_diagnostic.SA1200.severity = none
|
317 | 349 | dotnet_diagnostic.SA1201.severity = none
|
318 | 350 | dotnet_diagnostic.SA1202.severity = none
|
319 | 351 | dotnet_diagnostic.SA1309.severity = none
|
320 | 352 | dotnet_diagnostic.SA1310.severity = none
|
| 353 | + |
| 354 | +# Hide warnings for record parameters. |
| 355 | +dotnet_diagnostic.SA1313.severity = none |
| 356 | + |
| 357 | +# TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this. |
| 358 | +dotnet_diagnostic.SA1314.severity = none |
| 359 | + |
| 360 | +# UseTrailingCommasInMultiLineInitializers: This would also mean a lot of changes at the end of all multiline initializers. It's also debatable if we want this or not. |
| 361 | +dotnet_diagnostic.SA1413.severity = none |
| 362 | + |
321 | 363 | dotnet_diagnostic.SA1600.severity = none
|
322 | 364 | dotnet_diagnostic.SA1602.severity = none
|
323 | 365 | dotnet_diagnostic.SA1611.severity = none
|
| 366 | + |
| 367 | +# DocumentationTextMustEndWithAPeriod: Let's enable this rule back when we shift to WinUI3 (v8.x). If we do it now, it would mean more than 400 file changes. |
| 368 | +dotnet_diagnostic.SA1629.severity = none |
| 369 | + |
324 | 370 | dotnet_diagnostic.SA1633.severity = none
|
325 | 371 | dotnet_diagnostic.SA1634.severity = none
|
326 | 372 | dotnet_diagnostic.SA1652.severity = none
|
327 |
| - |
328 |
| -dotnet_diagnostic.SA1629.severity = none # DocumentationTextMustEndWithAPeriod: Let's enable this rule back when we shift to WinUI3 (v8.x). If we do it now, it would mean more than 400 file changes. |
329 |
| -dotnet_diagnostic.SA1413.severity = none # UseTrailingCommasInMultiLineInitializers: This would also mean a lot of changes at the end of all multiline initializers. It's also debatable if we want this or not. |
330 |
| -dotnet_diagnostic.SA1314.severity = none # TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this. |
331 |
| -dotnet_diagnostic.SA1000.severity = none # Hide warnings when using the new() expression from C# 9. |
332 |
| -dotnet_diagnostic.SA1313.severity = none # Hide warnings for record parameters. |
333 |
| -dotnet_diagnostic.SA1101.severity = none # Hide warnings when accessing properties without "this". |
|
0 commit comments