Skip to content

Commit 4ec02d5

Browse files
committed
Format and Update EditorConfig
- Update comments to be more to the point. - Rearrange some lines in ascending order. - Add more file types and their preferences. - Rename missed files from previous renames.
1 parent f67ccd1 commit 4ec02d5

File tree

4 files changed

+61
-22
lines changed

4 files changed

+61
-22
lines changed

.editorconfig

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,49 @@
11
# Remove the line below if you want to inherit .editorconfig settings from higher directories
22
root = true
33

4-
# C# files
5-
[*.cs]
4+
# All files
5+
[*]
66

77
#### Core EditorConfig Options ####
88

99
# Encoding
1010
charset = utf-8
1111

1212
# Indentation and spacing
13+
tab_width = 4
1314
indent_size = 4
1415
indent_style = space
15-
tab_width = 4
1616

1717
# New line preferences
18-
end_of_line = crlf
18+
end_of_line = unset
1919
insert_final_newline = false
2020

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+
2147
#### .NET Coding Conventions ####
2248

2349
# this. and Me. preferences
@@ -138,8 +164,8 @@ csharp_space_between_square_brackets = false
138164
csharp_preserve_single_line_blocks = true
139165
csharp_preserve_single_line_statements = true
140166

141-
142167
# Naming Symbols
168+
143169
# constant_fields - Define constant fields
144170
dotnet_naming_symbols.constant_fields.applicable_kinds = field
145171
dotnet_naming_symbols.constant_fields.required_modifiers = const
@@ -171,6 +197,7 @@ dotnet_naming_symbols.non_interface_types.applicable_kinds
171197
dotnet_naming_symbols.interface_types.applicable_kinds = interface
172198

173199
# Naming Styles
200+
174201
# camel_case - Define the camelCase style
175202
dotnet_naming_style.camel_case.capitalization = camel_case
176203
# pascal_case - Define the Pascal_case style
@@ -239,15 +266,8 @@ dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style
239266
dotnet_naming_style.prefix_private_field_with_underscore.capitalization = camel_case
240267
dotnet_naming_style.prefix_private_field_with_underscore.required_prefix = _
241268

242-
# Code files
269+
# .NET Code Analysis
243270

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
251271
dotnet_diagnostic.CA1001.severity = warning
252272
dotnet_diagnostic.CA1009.severity = warning
253273
dotnet_diagnostic.CA1016.severity = warning
@@ -310,24 +330,43 @@ dotnet_diagnostic.CA2238.severity = warning
310330
dotnet_diagnostic.CA2240.severity = warning
311331
dotnet_diagnostic.CA2241.severity = warning
312332
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+
313342
dotnet_diagnostic.SA1011.severity = none
314343
dotnet_diagnostic.SA1101.severity = none
344+
345+
# Hide warnings when accessing properties without "this".
346+
dotnet_diagnostic.SA1101.severity = none
315347
dotnet_diagnostic.SA1118.severity = none
316348
dotnet_diagnostic.SA1200.severity = none
317349
dotnet_diagnostic.SA1201.severity = none
318350
dotnet_diagnostic.SA1202.severity = none
319351
dotnet_diagnostic.SA1309.severity = none
320352
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+
321363
dotnet_diagnostic.SA1600.severity = none
322364
dotnet_diagnostic.SA1602.severity = none
323365
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+
324370
dotnet_diagnostic.SA1633.severity = none
325371
dotnet_diagnostic.SA1634.severity = none
326372
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".

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MarkdownTextBlock/InitialContent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ To add an image, it is almost like a link. You just need to add a \! before.
376376

377377
So inline image syntax looks like this:
378378

379-
>\!\[Helpers Image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/Microsoft.Toolkit.Uwp.SampleApp/Assets/Helpers.png)
379+
>\!\[Helpers Image](https\://raw.githubusercontent.com/CommunityToolkit/WindowsCommunityToolkit/main/Microsoft.Toolkit.Uwp.SampleApp/Assets/Helpers.png)
380380
381381
which renders in:
382382

@@ -412,7 +412,7 @@ which renders in:
412412

413413
MarkdownTextblock supports links wrapped with Images.
414414

415-
>\[!\[image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png)](https\://docs.microsoft.com/windows/uwpcommunitytoolkit/)
415+
>\[!\[image](https\://raw.githubusercontent.com/CommunityToolkit/WindowsCommunityToolkit/main/build/nuget.png)](https\://docs.microsoft.com/windows/uwpcommunitytoolkit/)
416416
417417
will render into
418418

File renamed without changes.

0 commit comments

Comments
 (0)