1
+ # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017
2
+
3
+ # ##############################
4
+ # Core EditorConfig Options #
5
+ # ##############################
6
+ root = true
7
+
8
+ # ##############################
9
+ # File Formatting Options #
10
+ # ##############################
11
+ [* .cs ]
12
+ indent_style = tab
13
+ indent_size = 4
14
+ charset = utf-8
15
+ end_of_line = crlf
16
+ insert_final_newline = true
17
+ trim_trailing_whitespace = true
18
+
19
+ # ##############################
20
+ # C# Formatting Rules #
21
+ # ##############################
22
+ csharp_new_line_before_open_brace = all
23
+ csharp_space_between_method_declaration_parameter_list_parentheses = false
24
+ csharp_space_between_method_call_parameter_list_parentheses = true
25
+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
26
+ csharp_space_after_keywords_in_control_flow_statements = true
27
+ csharp_space_between_parentheses = control_flow_statements
28
+ csharp_indent_case_contents = true
29
+ csharp_indent_switch_labels = true
30
+
31
+ # ### Рекомендации по написанию кода .NET ####
32
+
33
+ # Упорядочение Using
34
+ dotnet_separate_import_directive_groups = false
35
+ dotnet_sort_system_directives_first = true
36
+ file_header_template = unset
37
+
38
+ # Предпочтения для this. и Me.
39
+ dotnet_style_qualification_for_event = false :silent
40
+ dotnet_style_qualification_for_field = false :silent
41
+ dotnet_style_qualification_for_method = false :silent
42
+ dotnet_style_qualification_for_property = false :silent
43
+
44
+ # Параметры использования ключевых слов языка и типов BCL
45
+ dotnet_style_predefined_type_for_locals_parameters_members = true :silent
46
+ dotnet_style_predefined_type_for_member_access = true :silent
47
+
48
+ # Предпочтения для скобок
49
+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
50
+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
51
+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
52
+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
53
+
54
+ # Предпочтения модификатора
55
+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
56
+
57
+ # Выражения уровень предпочтения
58
+ dotnet_style_coalesce_expression = true :suggestion
59
+ dotnet_style_collection_initializer = true :warning
60
+ dotnet_style_explicit_tuple_names = true :suggestion
61
+ dotnet_style_null_propagation = true :suggestion
62
+ dotnet_style_object_initializer = true :suggestion
63
+ dotnet_style_operator_placement_when_wrapping = beginning_of_line
64
+ dotnet_style_prefer_auto_properties = true :suggestion
65
+ dotnet_style_prefer_compound_assignment = true :suggestion
66
+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
67
+ dotnet_style_prefer_conditional_expression_over_return = true :silent
68
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
69
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
70
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
71
+ dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
72
+ dotnet_style_prefer_simplified_interpolation = true :suggestion
73
+
74
+ # Предпочтения для полей
75
+ dotnet_style_readonly_field = true :silent
76
+
77
+ # Настройки параметров
78
+ dotnet_code_quality_unused_parameters = all:suggestion
79
+
80
+ # ### Рекомендации по написанию кода C# ####
81
+
82
+ # Предпочтения var
83
+ csharp_style_var_elsewhere = false :silent
84
+ csharp_style_var_for_built_in_types = false :silent
85
+ csharp_style_var_when_type_is_apparent = true :silent
86
+
87
+ # Члены, заданные выражениями
88
+ csharp_style_expression_bodied_accessors = true :suggestion
89
+ csharp_style_expression_bodied_constructors = false :silent
90
+ csharp_style_expression_bodied_indexers = true :silent
91
+ csharp_style_expression_bodied_lambdas = true :silent
92
+ csharp_style_expression_bodied_local_functions = false :silent
93
+ csharp_style_expression_bodied_methods = false :silent
94
+ csharp_style_expression_bodied_operators = false :silent
95
+ csharp_style_expression_bodied_properties = true :suggestion
96
+
97
+ # Настройки соответствия шаблонов
98
+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
99
+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
100
+ csharp_style_prefer_switch_expression = true :suggestion
101
+
102
+ # Настройки проверки на null
103
+ csharp_style_conditional_delegate_call = true :suggestion
104
+
105
+ # Предпочтения модификатора
106
+ csharp_prefer_static_local_function = true :suggestion
107
+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
108
+
109
+ # Предпочтения для блоков кода
110
+ csharp_prefer_braces = when_multiline:suggestion
111
+ csharp_prefer_simple_using_statement = false :suggestion
112
+
113
+ # Выражения уровень предпочтения
114
+ csharp_prefer_simple_default_expression = true :suggestion
115
+ csharp_style_deconstructed_variable_declaration = true :suggestion
116
+ csharp_style_inlined_variable_declaration = true :suggestion
117
+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
118
+ csharp_style_prefer_index_operator = true :suggestion
119
+ csharp_style_prefer_range_operator = true :suggestion
120
+ csharp_style_throw_expression = true :suggestion
121
+ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
122
+ csharp_style_unused_value_expression_statement_preference = discard_variable:silent
123
+
124
+ # предпочтения для директивы using
125
+ csharp_using_directive_placement = outside_namespace:silent
126
+
127
+ # ### Правила форматирования C# ####
128
+
129
+ # Предпочтения для новых строк
130
+ csharp_new_line_before_catch = true
131
+ csharp_new_line_before_else = true
132
+ csharp_new_line_before_finally = true
133
+ csharp_new_line_before_members_in_anonymous_types = true
134
+ csharp_new_line_before_members_in_object_initializers = true
135
+ csharp_new_line_before_open_brace = all
136
+ csharp_new_line_between_query_expression_clauses = true
137
+
138
+ # Предпочтения для отступов
139
+ csharp_indent_block_contents = true
140
+ csharp_indent_braces = false
141
+ csharp_indent_case_contents = false
142
+ csharp_indent_case_contents_when_block = true
143
+ csharp_indent_labels = one_less_than_current
144
+ csharp_indent_switch_labels = true
145
+
146
+ # Предпочтения для интервалов
147
+ csharp_space_after_cast = false
148
+ csharp_space_after_colon_in_inheritance_clause = true
149
+ csharp_space_after_comma = true
150
+ csharp_space_after_dot = false
151
+ csharp_space_after_keywords_in_control_flow_statements = true
152
+ csharp_space_after_semicolon_in_for_statement = true
153
+ csharp_space_around_binary_operators = before_and_after
154
+ csharp_space_around_declaration_statements = false
155
+ csharp_space_before_colon_in_inheritance_clause = true
156
+ csharp_space_before_comma = false
157
+ csharp_space_before_dot = false
158
+ csharp_space_before_open_square_brackets = false
159
+ csharp_space_before_semicolon_in_for_statement = false
160
+ csharp_space_between_empty_square_brackets = false
161
+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
162
+ csharp_space_between_method_call_name_and_opening_parenthesis = false
163
+ csharp_space_between_method_call_parameter_list_parentheses = false
164
+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
165
+ csharp_space_between_method_declaration_name_and_open_parenthesis = true
166
+ csharp_space_between_method_declaration_parameter_list_parentheses = false
167
+ csharp_space_between_parentheses = control_flow_statements,expressions
168
+ csharp_space_between_square_brackets = false
169
+
170
+ # Предпочтения переноса
171
+ csharp_preserve_single_line_blocks = true
172
+ csharp_preserve_single_line_statements = false
173
+
174
+ # ### Стили именования ####
175
+
176
+ # Правила именования
177
+
178
+ dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
179
+ dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
180
+ dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
181
+
182
+ dotnet_naming_rule.types_should_be_pascal_case.severity = error
183
+ dotnet_naming_rule.types_should_be_pascal_case.symbols = types
184
+ dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
185
+
186
+ dotnet_naming_rule.enum_should_be_pascal_case.severity = error
187
+ dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
188
+ dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
189
+
190
+ dotnet_naming_rule.property_should_be_pascal_case.severity = warning
191
+ dotnet_naming_rule.property_should_be_pascal_case.symbols = property
192
+ dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
193
+
194
+ dotnet_naming_rule.public_member_should_be_pascal_case.severity = suggestion
195
+ dotnet_naming_rule.public_member_should_be_pascal_case.symbols = public_member
196
+ dotnet_naming_rule.public_member_should_be_pascal_case.style = pascal_case
197
+
198
+ dotnet_naming_rule.parameter_should_be_camelcase.severity = suggestion
199
+ dotnet_naming_rule.parameter_should_be_camelcase.symbols = parameter
200
+ dotnet_naming_rule.parameter_should_be_camelcase.style = camelcase
201
+
202
+ dotnet_naming_rule.non_public_field_and_method_should_be__camelcase.severity = suggestion
203
+ dotnet_naming_rule.non_public_field_and_method_should_be__camelcase.symbols = non_public_field_and_method
204
+ dotnet_naming_rule.non_public_field_and_method_should_be__camelcase.style = _camelcase
205
+
206
+
207
+ # Спецификации символов
208
+
209
+ # Спецификации символов
210
+
211
+ dotnet_naming_symbols.interface.applicable_kinds = interface
212
+ dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
213
+ dotnet_naming_symbols.interface.required_modifiers =
214
+
215
+ dotnet_naming_symbols.enum.applicable_kinds = enum
216
+ dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
217
+ dotnet_naming_symbols.enum.required_modifiers =
218
+
219
+ dotnet_naming_symbols.property.applicable_kinds = property
220
+ dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
221
+ dotnet_naming_symbols.property.required_modifiers =
222
+
223
+ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
224
+ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
225
+ dotnet_naming_symbols.types.required_modifiers =
226
+
227
+ dotnet_naming_symbols.non_public_field_and_method.applicable_kinds = field, method
228
+ dotnet_naming_symbols.non_public_field_and_method.applicable_accessibilities = internal, private, protected, local
229
+ dotnet_naming_symbols.non_public_field_and_method.required_modifiers =
230
+
231
+ dotnet_naming_symbols.public_member.applicable_kinds = property, field, event, delegate, method
232
+ dotnet_naming_symbols.public_member.applicable_accessibilities = public
233
+ dotnet_naming_symbols.public_member.required_modifiers =
234
+
235
+ dotnet_naming_symbols.parameter.applicable_kinds = parameter
236
+ dotnet_naming_symbols.parameter.applicable_accessibilities =
237
+ dotnet_naming_symbols.parameter.required_modifiers =
238
+
239
+ # Стили именования
240
+
241
+ dotnet_naming_style.pascal_case.required_prefix =
242
+ dotnet_naming_style.pascal_case.required_suffix =
243
+ dotnet_naming_style.pascal_case.word_separator =
244
+ dotnet_naming_style.pascal_case.capitalization = pascal_case
245
+
246
+ dotnet_naming_style.begins_with_i.required_prefix = I
247
+ dotnet_naming_style.begins_with_i.required_suffix =
248
+ dotnet_naming_style.begins_with_i.word_separator =
249
+ dotnet_naming_style.begins_with_i.capitalization = pascal_case
250
+
251
+ dotnet_naming_style.camelcase.required_prefix =
252
+ dotnet_naming_style.camelcase.required_suffix =
253
+ dotnet_naming_style.camelcase.word_separator =
254
+ dotnet_naming_style.camelcase.capitalization = camel_case
255
+
256
+ dotnet_naming_style._camelcase.required_prefix = _
257
+ dotnet_naming_style._camelcase.required_suffix =
258
+ dotnet_naming_style._camelcase.word_separator =
259
+ dotnet_naming_style._camelcase.capitalization = camel_case
0 commit comments