Skip to content

Commit 8b5df56

Browse files
committed
* Re-order code to public, protected, internal, private
1 parent 73704fe commit 8b5df56

File tree

6 files changed

+772
-741
lines changed

6 files changed

+772
-741
lines changed

.editorconfig

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ trim_trailing_whitespace = true
66
insert_final_newline = true
77
indent_style = space
88
indent_size = 4
9+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
10+
tab_width = 4
11+
end_of_line = crlf
12+
dotnet_style_coalesce_expression = true:suggestion
13+
dotnet_style_null_propagation = true:suggestion
14+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
15+
dotnet_style_prefer_auto_properties = true:suggestion
16+
dotnet_style_object_initializer = true:suggestion
17+
dotnet_style_collection_initializer = true:suggestion
18+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
19+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
20+
dotnet_style_prefer_conditional_expression_over_return = true:silent
21+
dotnet_style_explicit_tuple_names = true:suggestion
22+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
23+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
924

1025
[*.cs]
1126
# New line preferences
@@ -26,7 +41,7 @@ csharp_indent_switch_labels = true
2641
csharp_indent_labels = one_less_than_current
2742

2843
# Modifier preferences
29-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
44+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:error
3045

3146
# avoid this. unless absolutely necessary
3247
dotnet_style_qualification_for_field = false:suggestion
@@ -44,15 +59,15 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
4459
# name all constant fields using PascalCase
4560
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
4661
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
47-
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
62+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
4863
dotnet_naming_symbols.constant_fields.applicable_kinds = field
4964
dotnet_naming_symbols.constant_fields.required_modifiers = const
5065
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
5166

5267
# static fields should have s_ prefix
5368
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
5469
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
55-
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
70+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
5671
dotnet_naming_symbols.static_fields.applicable_kinds = field
5772
dotnet_naming_symbols.static_fields.required_modifiers = static
5873
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
@@ -62,7 +77,7 @@ dotnet_naming_style.static_prefix_style.capitalization = camel_case
6277
# internal and private fields should be _camelCase
6378
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
6479
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
65-
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
80+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
6681
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
6782
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
6883
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
@@ -71,7 +86,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
7186
# Code style defaults
7287
csharp_using_directive_placement = outside_namespace:suggestion
7388
dotnet_sort_system_directives_first = true
74-
csharp_prefer_braces = true:refactoring
89+
csharp_prefer_braces = true:silent
7590
csharp_preserve_single_line_blocks = true:none
7691
csharp_preserve_single_line_statements = false:none
7792
csharp_prefer_static_local_function = true:suggestion
@@ -97,14 +112,14 @@ dotnet_style_prefer_conditional_expression_over_return = true:refactoring
97112
csharp_prefer_simple_default_expression = true:suggestion
98113

99114
# Expression-bodied members
100-
csharp_style_expression_bodied_methods = true:refactoring
101-
csharp_style_expression_bodied_constructors = true:refactoring
102-
csharp_style_expression_bodied_operators = true:refactoring
103-
csharp_style_expression_bodied_properties = true:refactoring
104-
csharp_style_expression_bodied_indexers = true:refactoring
105-
csharp_style_expression_bodied_accessors = true:refactoring
106-
csharp_style_expression_bodied_lambdas = true:refactoring
107-
csharp_style_expression_bodied_local_functions = true:refactoring
115+
csharp_style_expression_bodied_methods = true:silent
116+
csharp_style_expression_bodied_constructors = true:silent
117+
csharp_style_expression_bodied_operators = true:silent
118+
csharp_style_expression_bodied_properties = true:silent
119+
csharp_style_expression_bodied_indexers = true:silent
120+
csharp_style_expression_bodied_accessors = true:silent
121+
csharp_style_expression_bodied_lambdas = true:silent
122+
csharp_style_expression_bodied_local_functions = true:silent
108123

109124
# Pattern matching
110125
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
@@ -158,6 +173,8 @@ csharp_space_between_parentheses = false
158173
csharp_space_between_square_brackets = false
159174

160175
# Analyzers
176+
dotnet_diagnostic.IDE0036.severity = error
177+
161178
dotnet_code_quality.api_surface = public
162179
dotnet_code_quality.ca1802.api_surface = private, internal
163180

@@ -170,6 +187,11 @@ dotnet_diagnostic.RS0041.severity = none
170187
dotnet_diagnostic.RS0051.severity = none
171188

172189
dotnet_diagnostic.CA2007.severity = error
190+
csharp_style_namespace_declarations = block_scoped:silent
191+
csharp_style_prefer_method_group_conversion = true:silent
192+
csharp_style_prefer_top_level_statements = true:silent
193+
csharp_style_prefer_primary_constructors = true:suggestion
194+
csharp_prefer_system_threading_lock = true:suggestion
173195

174196
# C++ Files
175197
[*.{cpp,h,in}]

projects/Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<PublicKey>00240000048000009400000006020000002400005253413100040000010001008d20ec856aeeb8c3153a77faa2d80e6e43b5db93224a20cc7ae384f65f142e89730e2ff0fcc5d578bbe96fa98a7196c77329efdee4579b3814c0789e5a39b51df6edd75b602a33ceabdfcf19a3feb832f31d8254168cd7ba5700dfbca301fbf8db614ba41ba18474de0a5f4c2d51c995bc3636c641c8cbe76f45717bfcb943b5</PublicKey>
55
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
6+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
67
</PropertyGroup>
78

89
<ItemGroup>

0 commit comments

Comments
 (0)