1
+ # EditorConfig is awesome:http://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Don't use tabs for indentation.
7
+ [* ]
8
+ indent_style = space
9
+ # (Please don't specify an indent_size here; that has too many unintended consequences.)
10
+
11
+ # Code files
12
+ [* .{cs,csx,vb,vbx} ]
13
+ indent_size = 4
14
+ insert_final_newline = true
15
+ charset = utf-8-bom
16
+
17
+ # Xml project files
18
+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
19
+ indent_size = 2
20
+
21
+ # Xml config files
22
+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
23
+ indent_size = 2
24
+
25
+ # Yml/Yaml files
26
+ [* .{yaml,yml} ]
27
+ indent_size = 2
28
+
29
+ # JSON files
30
+ [* .json ]
31
+ indent_size = 2
32
+
33
+ # Shell scripts
34
+ [* .sh ]
35
+ end_of_line = lf
36
+
37
+ [* .{cmd,bat} ]
38
+ end_of_line = crlf
39
+
40
+ # Dotnet code style settings:
41
+ [* .{cs,vb} ]
42
+ # Sort using and Import directives with System.* appearing first
43
+ dotnet_sort_system_directives_first = true
44
+ # Put a blank line between System.* and Microsoft.*
45
+ dotnet_separate_import_directive_groups = true
46
+
47
+ # Avoid "this." and "Me." if not necessary
48
+ dotnet_style_qualification_for_field = false :suggestion
49
+ dotnet_style_qualification_for_property = false :suggestion
50
+ dotnet_style_qualification_for_method = false :suggestion
51
+ dotnet_style_qualification_for_event = false :suggestion
52
+
53
+ # Use language keywords instead of framework type names for type references
54
+ dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
55
+ dotnet_style_predefined_type_for_member_access = true :suggestion
56
+
57
+ # Prefer read-only on fields
58
+ dotnet_style_readonly_field = true :warning
59
+
60
+ # Suggest more modern language features when available
61
+ dotnet_style_object_initializer = true :suggestion
62
+ dotnet_style_collection_initializer = true :suggestion
63
+ dotnet_style_coalesce_expression = true :suggestion
64
+ dotnet_style_null_propagation = true :suggestion
65
+ dotnet_style_explicit_tuple_names = true :suggestion
66
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
67
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
68
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
69
+ dotnet_style_prefer_conditional_expression_over_return = false
70
+ dotnet_style_prefer_conditional_expression_over_assignment = false
71
+ dotnet_style_prefer_auto_properties = true
72
+
73
+ # Accessibility modifiers
74
+ dotnet_style_require_accessibility_modifiers = always:suggestion
75
+
76
+
77
+ # Naming Rules
78
+
79
+ # Interfaces start with an I and are PascalCased
80
+ dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.symbols = interface_symbols
81
+ dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.style = pascal_case_and_prefix_with_I_style
82
+ dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.severity = warning
83
+
84
+ # External members are PascalCased
85
+ dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.symbols = externally_visible_symbols
86
+ dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.style = pascal_case_style
87
+ dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.severity = warning
88
+
89
+ # Parameters are camelCased
90
+ dotnet_naming_rule.parameters_must_be_camel_cased.symbols = parameter_symbols
91
+ dotnet_naming_rule.parameters_must_be_camel_cased.style = camel_case_style
92
+ dotnet_naming_rule.parameters_must_be_camel_cased.severity = warning
93
+
94
+ # Constants are PascalCased
95
+ dotnet_naming_rule.constants_must_be_pascal_cased.symbols = constant_symbols
96
+ dotnet_naming_rule.constants_must_be_pascal_cased.style = pascal_case_style
97
+ dotnet_naming_rule.constants_must_be_pascal_cased.severity = warning
98
+
99
+ # Uncomment this group and comment out the next group if you prefer s_ prefixes for static fields
100
+
101
+ # Private static fields are prefixed with s_ and are camelCased like s_myStatic
102
+ # dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.symbols = private_static_field_symbols
103
+ # dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.style = camel_case_and_prefix_with_s_underscore_style
104
+ # dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.severity = warning
105
+
106
+ # Static readonly fields are PascalCased
107
+ dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.symbols = private_static_readonly_field_symbols
108
+ dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.style = pascal_case_style
109
+ dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.severity = warning
110
+
111
+ # Comment this group and uncomment out the next group if you don't want _ prefixed fields.
112
+
113
+ # Private instance fields are camelCased with an _ like _myField
114
+ dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = private_field_symbols
115
+ dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.style = camel_case_and_prefix_with_underscore_style
116
+ dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.severity = warning
117
+
118
+ # Private instance fields are camelCased
119
+ # dotnet_naming_rule.private_instance_fields_must_be_camel_cased.symbols = private_field_symbols
120
+ # dotnet_naming_rule.private_instance_fields_must_be_camel_cased.style = camel_case_style
121
+ # dotnet_naming_rule.private_instance_fields_must_be_camel_cased.severity = warning
122
+
123
+ # Symbols
124
+ dotnet_naming_symbols.externally_visible_symbols.applicable_kinds = class,struct,interface,enum,property,method,field,event,delegate
125
+ dotnet_naming_symbols.externally_visible_symbols.applicable_accessibilities = public,internal,friend,protected,protected_internal,protected_friend,private_protected
126
+
127
+ dotnet_naming_symbols.interface_symbols.applicable_kinds = interface
128
+ dotnet_naming_symbols.interface_symbols.applicable_accessibilities = *
129
+
130
+ dotnet_naming_symbols.parameter_symbols.applicable_kinds = parameter
131
+ dotnet_naming_symbols.parameter_symbols.applicable_accessibilities = *
132
+
133
+ dotnet_naming_symbols.constant_symbols.applicable_kinds = field
134
+ dotnet_naming_symbols.constant_symbols.required_modifiers = const
135
+ dotnet_naming_symbols.constant_symbols.applicable_accessibilities = *
136
+
137
+ dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field
138
+ dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static,shared
139
+ dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private
140
+
141
+ dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_kinds = field
142
+ dotnet_naming_symbols.private_static_readonly_field_symbols.required_modifiers = static,shared,readonly
143
+ dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_accessibilities = private
144
+
145
+ dotnet_naming_symbols.private_field_symbols.applicable_kinds = field
146
+ dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private
147
+
148
+ # Styles
149
+ dotnet_naming_style.camel_case_style.capitalization = camel_case
150
+
151
+ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
152
+
153
+ dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.required_prefix = s_
154
+ dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.capitalization = camel_case
155
+
156
+ dotnet_naming_style.camel_case_and_prefix_with_underscore_style.required_prefix = _
157
+ dotnet_naming_style.camel_case_and_prefix_with_underscore_style.capitalization = camel_case
158
+
159
+ dotnet_naming_style.pascal_case_and_prefix_with_I_style.required_prefix = I
160
+ dotnet_naming_style.pascal_case_and_prefix_with_I_style.capitalization = pascal_case
161
+
162
+
163
+ # CSharp code style settings:
164
+ [* .cs ]
165
+ # Indentation preferences
166
+ csharp_indent_block_contents = true
167
+ csharp_indent_braces = false
168
+ csharp_indent_case_contents = true
169
+ csharp_indent_switch_labels = true
170
+ csharp_indent_labels = flush_left
171
+
172
+ # Prefer "var" everywhere
173
+ csharp_style_var_for_built_in_types = true :suggestion
174
+ csharp_style_var_when_type_is_apparent = true :suggestion
175
+ csharp_style_var_elsewhere = true :suggestion
176
+
177
+ # Code style defaults
178
+ csharp_preserve_single_line_blocks = true
179
+ csharp_preserve_single_line_statements = true
180
+
181
+ # Prefer method-like constructs to have a block body
182
+ csharp_style_expression_bodied_methods = false :none
183
+ csharp_style_expression_bodied_constructors = false :none
184
+ csharp_style_expression_bodied_operators = false :none
185
+
186
+ # Prefer property-like constructs to have an expression-body
187
+ csharp_style_expression_bodied_properties = true :none
188
+ csharp_style_expression_bodied_indexers = true :none
189
+ csharp_style_expression_bodied_accessors = true :none
190
+
191
+ # Expression
192
+ csharp_prefer_simple_default_expression = true :suggestion
193
+ csharp_style_deconstructed_variable_declaration = true :suggestion
194
+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
195
+
196
+ # Pattern matching
197
+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
198
+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
199
+ csharp_style_inlined_variable_declaration = true :suggestion
200
+
201
+ # Null checking preferences
202
+ csharp_style_throw_expression = true :suggestion
203
+ csharp_style_conditional_delegate_call = true :suggestion
204
+
205
+ # Newline settings
206
+ csharp_new_line_before_open_brace = all
207
+ csharp_new_line_before_else = true
208
+ csharp_new_line_before_catch = true
209
+ csharp_new_line_before_finally = true
210
+ csharp_new_line_before_members_in_object_initializers = true
211
+ csharp_new_line_before_members_in_anonymous_types = true
212
+ csharp_new_line_between_query_expression_clauses = true
213
+
214
+ # Space preferences
215
+ csharp_space_after_cast = false
216
+ csharp_space_after_colon_in_inheritance_clause = true
217
+ csharp_space_after_comma = true
218
+ csharp_space_after_dot = false
219
+ csharp_space_after_keywords_in_control_flow_statements = true
220
+ csharp_space_after_semicolon_in_for_statement = true
221
+ csharp_space_around_binary_operators = before_and_after
222
+ csharp_space_around_declaration_statements = do_not_ignore
223
+ csharp_space_before_colon_in_inheritance_clause = true
224
+ csharp_space_before_comma = false
225
+ csharp_space_before_dot = false
226
+ csharp_space_before_open_square_brackets = false
227
+ csharp_space_before_semicolon_in_for_statement = false
228
+ csharp_space_between_empty_square_brackets = false
229
+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
230
+ csharp_space_between_method_call_name_and_opening_parenthesis = false
231
+ csharp_space_between_method_call_parameter_list_parentheses = false
232
+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
233
+ csharp_space_between_method_declaration_name_and_open_parenthesis = false
234
+ csharp_space_between_method_declaration_parameter_list_parentheses = false
235
+ csharp_space_between_parentheses = false
236
+ csharp_space_between_square_brackets = false
0 commit comments