|
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 | +# Encoding |
| 10 | +charset = utf-8 |
| 11 | + |
9 | 12 | # Indentation and spacing |
| 13 | +tab_width = 4 |
10 | 14 | indent_size = 4 |
11 | 15 | indent_style = space |
12 | | -tab_width = 4 |
13 | 16 |
|
14 | 17 | # New line preferences |
15 | | -end_of_line = crlf |
| 18 | +end_of_line = unset |
16 | 19 | insert_final_newline = false |
17 | 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 | + |
18 | 47 | #### .NET Coding Conventions #### |
19 | 48 |
|
20 | 49 | # this. and Me. preferences |
@@ -103,8 +132,8 @@ csharp_new_line_between_query_expression_clauses = true |
103 | 132 | csharp_indent_block_contents = true |
104 | 133 | csharp_indent_braces = false |
105 | 134 | csharp_indent_case_contents = true |
106 | | -csharp_indent_case_contents_when_block = true |
107 | | -csharp_indent_labels = one_less_than_current |
| 135 | +csharp_indent_case_contents_when_block = false |
| 136 | +csharp_indent_labels = no_change |
108 | 137 | csharp_indent_switch_labels = true |
109 | 138 |
|
110 | 139 | # Space preferences |
@@ -135,8 +164,8 @@ csharp_space_between_square_brackets = false |
135 | 164 | csharp_preserve_single_line_blocks = true |
136 | 165 | csharp_preserve_single_line_statements = true |
137 | 166 |
|
138 | | - |
139 | 167 | # Naming Symbols |
| 168 | + |
140 | 169 | # constant_fields - Define constant fields |
141 | 170 | dotnet_naming_symbols.constant_fields.applicable_kinds = field |
142 | 171 | dotnet_naming_symbols.constant_fields.required_modifiers = const |
@@ -168,6 +197,7 @@ dotnet_naming_symbols.non_interface_types.applicable_kinds |
168 | 197 | dotnet_naming_symbols.interface_types.applicable_kinds = interface |
169 | 198 |
|
170 | 199 | # Naming Styles |
| 200 | + |
171 | 201 | # camel_case - Define the camelCase style |
172 | 202 | dotnet_naming_style.camel_case.capitalization = camel_case |
173 | 203 | # pascal_case - Define the Pascal_case style |
@@ -236,15 +266,8 @@ dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style |
236 | 266 | dotnet_naming_style.prefix_private_field_with_underscore.capitalization = camel_case |
237 | 267 | dotnet_naming_style.prefix_private_field_with_underscore.required_prefix = _ |
238 | 268 |
|
239 | | -# Code files |
240 | | - |
241 | | -# SA1009: Closing parenthesis should be spaced correctly |
242 | | -# Needed for null forgiving operator after functions, "foo()!" |
243 | | -dotnet_diagnostic.SA1009.severity = none |
| 269 | +# .NET Code Analysis |
244 | 270 |
|
245 | | -[*.{cs,vb}] |
246 | | - |
247 | | -# Migrate back from old Toolkit.ruleset |
248 | 271 | dotnet_diagnostic.CA1001.severity = warning |
249 | 272 | dotnet_diagnostic.CA1009.severity = warning |
250 | 273 | dotnet_diagnostic.CA1016.severity = warning |
@@ -307,24 +330,43 @@ dotnet_diagnostic.CA2238.severity = warning |
307 | 330 | dotnet_diagnostic.CA2240.severity = warning |
308 | 331 | dotnet_diagnostic.CA2241.severity = warning |
309 | 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 | + |
310 | 342 | dotnet_diagnostic.SA1011.severity = none |
311 | 343 | dotnet_diagnostic.SA1101.severity = none |
| 344 | + |
| 345 | +# Hide warnings when accessing properties without "this". |
| 346 | +dotnet_diagnostic.SA1101.severity = none |
312 | 347 | dotnet_diagnostic.SA1118.severity = none |
313 | 348 | dotnet_diagnostic.SA1200.severity = none |
314 | 349 | dotnet_diagnostic.SA1201.severity = none |
315 | 350 | dotnet_diagnostic.SA1202.severity = none |
316 | 351 | dotnet_diagnostic.SA1309.severity = none |
317 | 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 | + |
318 | 363 | dotnet_diagnostic.SA1600.severity = none |
319 | 364 | dotnet_diagnostic.SA1602.severity = none |
320 | 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 | + |
321 | 370 | dotnet_diagnostic.SA1633.severity = none |
322 | 371 | dotnet_diagnostic.SA1634.severity = none |
323 | 372 | dotnet_diagnostic.SA1652.severity = none |
324 | | - |
325 | | -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. |
326 | | -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. |
327 | | -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. |
328 | | -dotnet_diagnostic.SA1000.severity = none # Hide warnings when using the new() expression from C# 9. |
329 | | -dotnet_diagnostic.SA1313.severity = none # Hide warnings for record parameters. |
330 | | -dotnet_diagnostic.SA1101.severity = none # Hide warnings when accessing properties without "this". |
|
0 commit comments