Skip to content

Commit 743b93a

Browse files
committed
Update EditorConfig and Git files
- Add default Git attributes. - Update Git ignores to latest. - Merge duplicate EditorConfig rules. - Format projects to EditorConfig rules. - Fix formatting errors in 'Guard.md' file.
1 parent 0891891 commit 743b93a

File tree

16 files changed

+189
-230
lines changed

16 files changed

+189
-230
lines changed

.editorconfig

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ indent_style = space
1717
# New line preferences
1818
end_of_line = unset
1919
insert_final_newline = false
20-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
21-
dotnet_style_readonly_field = true:warning
22-
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
23-
dotnet_style_predefined_type_for_member_access = true:warning
24-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
25-
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning
26-
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
27-
dotnet_style_qualification_for_field = true:warning
28-
dotnet_style_qualification_for_property = false:warning
29-
dotnet_style_qualification_for_method = false:warning
30-
dotnet_style_qualification_for_event = false:warning
3120

3221
#### Build files ####
3322

@@ -58,14 +47,14 @@ insert_final_newline = true
5847
#### .NET Coding Conventions ####
5948

6049
# this. and Me. preferences
61-
dotnet_style_qualification_for_event = true:silent
62-
dotnet_style_qualification_for_field = true:silent
63-
dotnet_style_qualification_for_method = true:silent
64-
dotnet_style_qualification_for_property = true:silent
50+
dotnet_style_qualification_for_event = false:warning
51+
dotnet_style_qualification_for_field = true:warning
52+
dotnet_style_qualification_for_method = false:warning
53+
dotnet_style_qualification_for_property = false:warning
6554

6655
# Language keywords vs BCL types preferences
67-
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
68-
dotnet_style_predefined_type_for_member_access = true:silent
56+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
57+
dotnet_style_predefined_type_for_member_access = true:warning
6958

7059
# Parentheses preferences
7160
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
@@ -74,7 +63,11 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
7463
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
7564

7665
# Modifier preferences
77-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
66+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
67+
68+
# Code block preferences
69+
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
70+
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning
7871

7972
# Expression-level preferences
8073
csharp_style_deconstructed_variable_declaration = true:suggestion
@@ -90,10 +83,10 @@ dotnet_style_prefer_conditional_expression_over_assignment = true:silent
9083
dotnet_style_prefer_conditional_expression_over_return = true:silent
9184
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
9285
dotnet_style_prefer_inferred_tuple_names = true:suggestion
93-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
86+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
9487

9588
# Field preferences
96-
dotnet_style_readonly_field = true:suggestion
89+
dotnet_style_readonly_field = true:warning
9790

9891
#### C# Coding Conventions ####
9992

@@ -112,6 +105,7 @@ csharp_style_expression_bodied_operators = false:silent
112105
csharp_style_expression_bodied_properties = false:silent
113106

114107
# Pattern matching preferences
108+
csharp_style_prefer_pattern_matching = true:suggestion
115109
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
116110
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
117111

@@ -123,9 +117,15 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter
123117

124118
# Code-block preferences
125119
csharp_prefer_braces = true:suggestion
120+
csharp_using_directive_placement = outside_namespace:warning
121+
csharp_style_namespace_declarations = file_scoped:warning
122+
csharp_style_unused_value_assignment_preference = discard_variable:warning
123+
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
124+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:warning
126125

127126
# Expression-level preferences
128127
csharp_prefer_simple_default_expression = true:suggestion
128+
csharp_prefer_static_local_function = true:warning
129129
csharp_style_pattern_local_over_anonymous_function = true:warning
130130

131131
#### C# Formatting Rules ####
@@ -381,10 +381,3 @@ dotnet_diagnostic.SA1629.severity = none
381381
dotnet_diagnostic.SA1633.severity = none
382382
dotnet_diagnostic.SA1634.severity = none
383383
dotnet_diagnostic.SA1652.severity = none
384-
csharp_using_directive_placement = outside_namespace:warning
385-
csharp_style_unused_value_assignment_preference = discard_variable:warning
386-
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
387-
csharp_prefer_static_local_function = true:warning
388-
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:warning
389-
csharp_style_prefer_pattern_matching = true:suggestion
390-
csharp_style_namespace_declarations = file_scoped:warning

.gitattributes

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,50 @@
1-
###############################################################################
2-
# Set default behavior to automatically normalize line endings.
3-
###############################################################################
1+
# Set default file-type attributes
2+
3+
# All file types
44
* text=auto
55

6-
###############################################################################
7-
# Set default behavior for command prompt diff.
8-
#
9-
# This is need for earlier builds of msysgit that does not have it on by
10-
# default for csharp files.
11-
# Note: This is only used by command line
12-
###############################################################################
13-
#*.cs diff=csharp
14-
15-
###############################################################################
16-
# Set the merge driver for project and solution files
17-
#
18-
# Merging from the command prompt will add diff markers to the files if there
19-
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
21-
# file extensions to fail to load in VS. An alternative would be to treat
22-
# these files as binary and thus will always conflict and require user
23-
# intervention with every merge. To do so, just uncomment the entries below
24-
###############################################################################
25-
#*.sln merge=binary
26-
#*.csproj merge=binary
27-
#*.vbproj merge=binary
28-
#*.vcxproj merge=binary
29-
#*.vcproj merge=binary
30-
#*.dbproj merge=binary
31-
#*.fsproj merge=binary
32-
#*.lsproj merge=binary
33-
#*.wixproj merge=binary
34-
#*.modelproj merge=binary
35-
#*.sqlproj merge=binary
36-
#*.wwaproj merge=binary
37-
38-
###############################################################################
39-
# behavior for image files
40-
#
41-
# image files are treated as binary by default.
42-
###############################################################################
43-
#*.jpg binary
44-
#*.png binary
45-
#*.gif binary
46-
47-
###############################################################################
48-
# diff behavior for common document formats
49-
#
50-
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
52-
# entries below.
53-
###############################################################################
54-
#*.doc diff=astextplain
55-
#*.DOC diff=astextplain
56-
#*.docx diff=astextplain
57-
#*.DOCX diff=astextplain
58-
#*.dot diff=astextplain
59-
#*.DOT diff=astextplain
60-
#*.pdf diff=astextplain
61-
#*.PDF diff=astextplain
62-
#*.rtf diff=astextplain
63-
#*.RTF diff=astextplain
6+
# Markups
7+
*.md text=auto diff=markdown
8+
*.mdx text=auto diff=markdown
9+
10+
# Solutions
11+
*.sln text=auto eol=crlf
12+
*.slnx text=auto
13+
14+
# Projects
15+
*.*proj text=auto
16+
*.tasks text=auto
17+
*.props text=auto
18+
*.targets text=auto
19+
20+
# Sources
21+
*.cs text=auto diff=csharp
22+
*.csx text=auto diff=csharp
23+
*.resx text=auto
24+
25+
# Scripts
26+
*.in text eol=lf
27+
*.sh text eol=lf
28+
*.bat text eol=crlf
29+
*.cmd text eol=crlf
30+
31+
# Images
32+
*.png binary
33+
*.jpg binary
34+
*.gif binary
35+
36+
# Keys
37+
*.snk binary
38+
*.pfx binary
39+
*.cer binary
40+
41+
# Others
42+
43+
# Preserve Line endings in diff and patch files
44+
*.diff -text
45+
*.patch -text
46+
47+
# Exclude git meta files from exporting
48+
.gitattributes export-ignore
49+
.gitignore export-ignore
50+
.gitkeep export-ignore

0 commit comments

Comments
 (0)