1
+ root = true
1
2
2
3
[* ]
3
- charset = utf-8-bom
4
+ charset = utf-8
4
5
end_of_line = lf
5
- trim_trailing_whitespace = false
6
- insert_final_newline = false
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = true
7
8
indent_style = space
8
9
indent_size = 4
9
10
10
11
# Microsoft .NET properties
11
- csharp_preferred_modifier_order = public, private, protected, internal, static, abstract, virtual, sealed, override, new, readonly, extern, unsafe, volatile, async:suggestion
12
+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new, virtual,abstract, sealed,override,readonly,unsafe,volatile,async:suggestion
12
13
csharp_style_var_elsewhere = true :suggestion
13
14
csharp_style_var_for_built_in_types = true :suggestion
14
15
csharp_style_var_when_type_is_apparent = true :suggestion
@@ -22,9 +23,72 @@ dotnet_style_qualification_for_field = false:suggestion
22
23
dotnet_style_qualification_for_method = false :suggestion
23
24
dotnet_style_qualification_for_property = false :suggestion
24
25
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
26
+ dotnet_sort_system_directives_first = true
27
+ dotnet_style_readonly_field = true :suggestion
28
+
29
+ # Expression-level preferences
30
+ dotnet_style_object_initializer = true :suggestion
31
+ dotnet_style_collection_initializer = true :suggestion
32
+ dotnet_style_explicit_tuple_names = true :suggestion
33
+ dotnet_style_coalesce_expression = true :suggestion
34
+ dotnet_style_null_propagation = true :suggestion
35
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
36
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
37
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
38
+ dotnet_style_prefer_auto_properties = true :suggestion
39
+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
40
+ dotnet_style_prefer_conditional_expression_over_return = true :silent
41
+ csharp_prefer_simple_default_expression = true :suggestion
42
+
43
+ # Expression-bodied members
44
+ csharp_style_expression_bodied_methods = true :silent
45
+ csharp_style_expression_bodied_constructors = true :silent
46
+ csharp_style_expression_bodied_operators = true :silent
47
+ csharp_style_expression_bodied_properties = true :silent
48
+ csharp_style_expression_bodied_indexers = true :silent
49
+ csharp_style_expression_bodied_accessors = true :silent
50
+ csharp_style_expression_bodied_lambdas = true :silent
51
+ csharp_style_expression_bodied_local_functions = true :silent
52
+
53
+ # Pattern matching
54
+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
55
+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
56
+ csharp_style_inlined_variable_declaration = true :suggestion
57
+
58
+ # Null checking preferences
59
+ csharp_style_throw_expression = true :suggestion
60
+ csharp_style_conditional_delegate_call = true :suggestion
61
+
62
+ # Other features
63
+ csharp_style_prefer_index_operator = false :none
64
+ csharp_style_prefer_range_operator = false :none
65
+ csharp_style_pattern_local_over_anonymous_function = false :none
66
+
67
+ # Space preferences
68
+ csharp_space_after_cast = false
69
+ csharp_space_after_colon_in_inheritance_clause = true
70
+ csharp_space_after_comma = true
71
+ csharp_space_after_dot = false
72
+ csharp_space_after_keywords_in_control_flow_statements = true
73
+ csharp_space_after_semicolon_in_for_statement = true
74
+ csharp_space_around_binary_operators = before_and_after
75
+ csharp_space_around_declaration_statements = false
76
+ csharp_space_before_colon_in_inheritance_clause = true
77
+ csharp_space_before_comma = false
78
+ csharp_space_before_dot = false
79
+ csharp_space_before_open_square_brackets = false
80
+ csharp_space_before_semicolon_in_for_statement = false
81
+ csharp_space_between_empty_square_brackets = false
82
+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
83
+ csharp_space_between_method_call_name_and_opening_parenthesis = false
84
+ csharp_space_between_method_call_parameter_list_parentheses = false
85
+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
86
+ csharp_space_between_method_declaration_name_and_open_parenthesis = false
87
+ csharp_space_between_method_declaration_parameter_list_parentheses = false
88
+ csharp_space_between_parentheses = false
89
+ csharp_space_between_square_brackets = false
25
90
26
91
# ReSharper properties
27
- resharper_autodetect_indent_settings = true
28
92
resharper_braces_for_for = required
29
93
resharper_braces_for_foreach = required
30
94
resharper_braces_for_ifelse = required
@@ -45,39 +109,18 @@ resharper_keep_existing_initializer_arrangement = false
45
109
resharper_keep_existing_invocation_parens_arrangement = false
46
110
resharper_keep_existing_switch_expression_arrangement = false
47
111
resharper_max_initializer_elements_on_line = 2
48
- resharper_modifiers_order = public private protected internal static abstract virtual sealed override new readonly extern unsafe volatile async
49
112
resharper_place_accessorholder_attribute_on_same_line = false
50
113
resharper_place_field_attribute_on_same_line = false
51
114
resharper_place_linq_into_on_new_line = false
52
115
resharper_place_simple_anonymousmethod_on_single_line = false
53
116
resharper_place_simple_embedded_statement_on_same_line = false
54
117
resharper_space_between_attribute_sections = false
55
- resharper_use_indent_from_vs = false
56
118
resharper_wrap_before_arrow_with_expressions = true
57
119
resharper_wrap_before_extends_colon = true
58
120
resharper_wrap_before_linq_expression = true
59
121
resharper_wrap_chained_binary_expressions = chop_if_long
60
122
61
123
# ReSharper inspection severities
62
- resharper_arrange_redundant_parentheses_highlighting = hint
63
- resharper_arrange_this_qualifier_highlighting = hint
64
- resharper_arrange_type_member_modifiers_highlighting = hint
65
- resharper_arrange_type_modifiers_highlighting = hint
66
- resharper_built_in_type_reference_style_for_member_access_highlighting = hint
67
- resharper_built_in_type_reference_style_highlighting = hint
68
- resharper_mvc_view_component_view_not_resolved_highlighting = none
69
- resharper_redundant_base_qualifier_highlighting = warning
70
- resharper_suggest_var_or_type_built_in_types_highlighting = hint
71
- resharper_suggest_var_or_type_elsewhere_highlighting = hint
72
- resharper_suggest_var_or_type_simple_types_highlighting = hint
73
- resharper_web_config_module_not_resolved_highlighting = warning
74
- resharper_web_config_type_not_resolved_highlighting = warning
75
- resharper_web_config_wrong_module_highlighting = warning
76
-
77
- [* .{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd} ]
78
- indent_style = space
79
- indent_size = 4
80
- tab_width = 4
81
124
82
125
[* .{xml,csproj} ]
83
126
indent_size = 2
@@ -87,46 +130,37 @@ tab_width = 2
87
130
[* .cs ]
88
131
89
132
# var preferences
90
- csharp_style_var_elsewhere = false :silent
91
- csharp_style_var_for_built_in_types = false :silent
133
+ csharp_style_var_elsewhere = false :suggestion
134
+ csharp_style_var_for_built_in_types = false :suggestion
92
135
csharp_style_var_when_type_is_apparent = false :silent
93
136
94
137
# Expression-bodied members
95
- csharp_style_expression_bodied_accessors = true :silent
96
138
csharp_style_expression_bodied_constructors = false :silent
97
- csharp_style_expression_bodied_indexers = true :silent
98
139
csharp_style_expression_bodied_lambdas = true :suggestion
99
140
csharp_style_expression_bodied_local_functions = false :silent
100
141
csharp_style_expression_bodied_methods = false :silent
101
142
csharp_style_expression_bodied_operators = false :silent
102
- csharp_style_expression_bodied_properties = true :silent
103
143
104
144
# Pattern matching preferences
105
- csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
106
- csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
107
145
csharp_style_prefer_not_pattern = true :suggestion
108
146
csharp_style_prefer_pattern_matching = true :silent
109
147
csharp_style_prefer_switch_expression = true :suggestion
110
148
111
149
# Null-checking preferences
112
- csharp_style_conditional_delegate_call = true :suggestion
113
150
114
151
# Modifier preferences
115
- csharp_prefer_static_local_function = true :warning
152
+ csharp_prefer_static_local_function = true :suggestion
116
153
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
117
154
118
155
# Code-block preferences
119
156
csharp_prefer_braces = true :silent
120
- csharp_prefer_simple_using_statement = true : suggestion
157
+ csharp_prefer_simple_using_statement = false : none
121
158
122
159
# Expression-level preferences
123
- csharp_prefer_simple_default_expression = true :suggestion
124
160
csharp_style_deconstructed_variable_declaration = true :suggestion
125
- csharp_style_inlined_variable_declaration = true :suggestion
126
161
csharp_style_pattern_local_over_anonymous_function = true :suggestion
127
162
csharp_style_prefer_index_operator = true :suggestion
128
163
csharp_style_prefer_range_operator = true :suggestion
129
- csharp_style_throw_expression = true :suggestion
130
164
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
131
165
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
132
166
@@ -152,36 +186,11 @@ csharp_indent_case_contents_when_block = true
152
186
csharp_indent_labels = one_less_than_current
153
187
csharp_indent_switch_labels = true
154
188
155
- # Space preferences
156
- csharp_space_after_cast = false
157
- csharp_space_after_colon_in_inheritance_clause = true
158
- csharp_space_after_comma = true
159
- csharp_space_after_dot = false
160
- csharp_space_after_keywords_in_control_flow_statements = true
161
- csharp_space_after_semicolon_in_for_statement = true
162
- csharp_space_around_binary_operators = before_and_after
163
- csharp_space_around_declaration_statements = false
164
- csharp_space_before_colon_in_inheritance_clause = true
165
- csharp_space_before_comma = false
166
- csharp_space_before_dot = false
167
- csharp_space_before_open_square_brackets = false
168
- csharp_space_before_semicolon_in_for_statement = false
169
- csharp_space_between_empty_square_brackets = false
170
- csharp_space_between_method_call_empty_parameter_list_parentheses = false
171
- csharp_space_between_method_call_name_and_opening_parenthesis = false
172
- csharp_space_between_method_call_parameter_list_parentheses = false
173
- csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
174
- csharp_space_between_method_declaration_name_and_open_parenthesis = false
175
- csharp_space_between_method_declaration_parameter_list_parentheses = false
176
- csharp_space_between_parentheses = false
177
- csharp_space_between_square_brackets = false
178
-
179
189
# Wrapping preferences
180
190
csharp_preserve_single_line_blocks = true
181
- csharp_preserve_single_line_statements = true
191
+ csharp_preserve_single_line_statements = false
182
192
183
193
# ### Naming styles ####
184
- [* .{cs,vb} ]
185
194
186
195
# Naming rules
187
196
@@ -261,67 +270,93 @@ dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion
261
270
dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members
262
271
dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
263
272
273
+ # name all constant fields using PascalCase
274
+ dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
275
+ dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
276
+ dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
277
+ dotnet_naming_symbols.constant_fields.applicable_kinds = field
278
+ dotnet_naming_symbols.constant_fields.required_modifiers = const
279
+ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
280
+
281
+ dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
282
+ dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
283
+ dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
284
+ dotnet_naming_symbols.static_fields.applicable_kinds = field
285
+ dotnet_naming_symbols.static_fields.required_modifiers = static
286
+ dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
287
+ dotnet_naming_style.static_prefix_style.required_prefix = s_
288
+ dotnet_naming_style.static_prefix_style.capitalization = camel_case
289
+
290
+ # internal and private fields should be _camelCase
291
+ dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
292
+ dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
293
+ dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
294
+ dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
295
+ dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
296
+ dotnet_naming_style.camel_case_underscore_style.required_prefix = _
297
+ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
298
+
264
299
# Symbol specifications
265
300
266
301
dotnet_naming_symbols.interfaces.applicable_kinds = interface
267
302
dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
268
- dotnet_naming_symbols.interfaces.required_modifiers =
303
+ dotnet_naming_symbols.interfaces.required_modifiers =
269
304
270
305
dotnet_naming_symbols.enums.applicable_kinds = enum
271
306
dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
272
- dotnet_naming_symbols.enums.required_modifiers =
307
+ dotnet_naming_symbols.enums.required_modifiers =
273
308
274
309
dotnet_naming_symbols.events.applicable_kinds = event
275
310
dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
276
- dotnet_naming_symbols.events.required_modifiers =
311
+ dotnet_naming_symbols.events.required_modifiers =
277
312
278
313
dotnet_naming_symbols.methods.applicable_kinds = method
279
314
dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
280
- dotnet_naming_symbols.methods.required_modifiers =
315
+ dotnet_naming_symbols.methods.required_modifiers =
281
316
282
317
dotnet_naming_symbols.properties.applicable_kinds = property
283
318
dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
284
- dotnet_naming_symbols.properties.required_modifiers =
319
+ dotnet_naming_symbols.properties.required_modifiers =
285
320
286
321
dotnet_naming_symbols.public_fields.applicable_kinds = field
287
322
dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
288
- dotnet_naming_symbols.public_fields.required_modifiers =
323
+ dotnet_naming_symbols.public_fields.required_modifiers =
289
324
290
325
dotnet_naming_symbols.private_fields.applicable_kinds = field
291
326
dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
292
- dotnet_naming_symbols.private_fields.required_modifiers =
327
+ dotnet_naming_symbols.private_fields.required_modifiers =
293
328
294
329
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
295
330
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
296
331
dotnet_naming_symbols.private_static_fields.required_modifiers = static
297
332
298
333
dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
299
334
dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
300
- dotnet_naming_symbols.types_and_namespaces.required_modifiers =
335
+ dotnet_naming_symbols.types_and_namespaces.required_modifiers =
301
336
302
337
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
303
338
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
304
- dotnet_naming_symbols.non_field_members.required_modifiers =
339
+ dotnet_naming_symbols.non_field_members.required_modifiers =
305
340
306
341
dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
307
342
dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
308
- dotnet_naming_symbols.type_parameters.required_modifiers =
343
+ dotnet_naming_symbols.type_parameters.required_modifiers =
309
344
310
345
dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
311
346
dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
312
347
dotnet_naming_symbols.private_constant_fields.required_modifiers = const
313
348
314
349
dotnet_naming_symbols.local_variables.applicable_kinds = local
315
350
dotnet_naming_symbols.local_variables.applicable_accessibilities = local
316
- dotnet_naming_symbols.local_variables.required_modifiers =
351
+ dotnet_naming_symbols.local_variables.required_modifiers =
317
352
318
353
dotnet_naming_symbols.local_constants.applicable_kinds = local
319
354
dotnet_naming_symbols.local_constants.applicable_accessibilities = local
320
355
dotnet_naming_symbols.local_constants.required_modifiers = const
321
356
322
357
dotnet_naming_symbols.parameters.applicable_kinds = parameter
323
358
dotnet_naming_symbols.parameters.applicable_accessibilities = *
324
- dotnet_naming_symbols.parameters.required_modifiers =
359
+ dotnet_naming_symbols.parameters.required_modifiers =
325
360
326
361
dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
327
362
dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
@@ -337,36 +372,40 @@ dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readon
337
372
338
373
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
339
374
dotnet_naming_symbols.local_functions.applicable_accessibilities = *
340
- dotnet_naming_symbols.local_functions.required_modifiers =
375
+ dotnet_naming_symbols.local_functions.required_modifiers =
341
376
342
377
# Naming styles
343
378
344
- dotnet_naming_style.pascalcase.required_prefix =
345
- dotnet_naming_style.pascalcase.required_suffix =
346
- dotnet_naming_style.pascalcase.word_separator =
379
+ dotnet_naming_style.pascalcase.required_prefix =
380
+ dotnet_naming_style.pascalcase.required_suffix =
381
+ dotnet_naming_style.pascalcase.word_separator =
347
382
dotnet_naming_style.pascalcase.capitalization = pascal_case
348
383
349
384
dotnet_naming_style.ipascalcase.required_prefix = I
350
- dotnet_naming_style.ipascalcase.required_suffix =
351
- dotnet_naming_style.ipascalcase.word_separator =
385
+ dotnet_naming_style.ipascalcase.required_suffix =
386
+ dotnet_naming_style.ipascalcase.word_separator =
352
387
dotnet_naming_style.ipascalcase.capitalization = pascal_case
353
388
354
389
dotnet_naming_style.tpascalcase.required_prefix = T
355
- dotnet_naming_style.tpascalcase.required_suffix =
356
- dotnet_naming_style.tpascalcase.word_separator =
390
+ dotnet_naming_style.tpascalcase.required_suffix =
391
+ dotnet_naming_style.tpascalcase.word_separator =
357
392
dotnet_naming_style.tpascalcase.capitalization = pascal_case
358
393
359
394
dotnet_naming_style._camelcase.required_prefix = _
360
- dotnet_naming_style._camelcase.required_suffix =
361
- dotnet_naming_style._camelcase.word_separator =
395
+ dotnet_naming_style._camelcase.required_suffix =
396
+ dotnet_naming_style._camelcase.word_separator =
362
397
dotnet_naming_style._camelcase.capitalization = camel_case
363
398
364
- dotnet_naming_style.camelcase.required_prefix =
365
- dotnet_naming_style.camelcase.required_suffix =
366
- dotnet_naming_style.camelcase.word_separator =
399
+ dotnet_naming_style.camelcase.required_prefix =
400
+ dotnet_naming_style.camelcase.required_suffix =
401
+ dotnet_naming_style.camelcase.word_separator =
367
402
dotnet_naming_style.camelcase.capitalization = camel_case
368
403
369
404
dotnet_naming_style.s_camelcase.required_prefix = s_
370
- dotnet_naming_style.s_camelcase.required_suffix =
371
- dotnet_naming_style.s_camelcase.word_separator =
372
- dotnet_naming_style.s_camelcase.capitalization = camel_case
405
+ dotnet_naming_style.s_camelcase.required_suffix =
406
+ dotnet_naming_style.s_camelcase.word_separator =
407
+ dotnet_naming_style.s_camelcase.capitalization = camel_case
408
+
409
+ # Xml config files
410
+ [* .{props,targets,config,nuspec} ]
411
+ indent_size = 2
0 commit comments