-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.editorconfig
253 lines (227 loc) · 14.7 KB
/
.editorconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
root = true
################################################################
# Global preferences #
################################################################
# All files
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
[*.{cs,vb}]
################################################################
# .NET / C# Whitespace preferences #
################################################################
# Expression-level preferences
dotnet_style_operator_placement_when_wrapping = beginning_of_line
# Indentation & spacing
indent_size = 4
tab_width = 4
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents_when_block = true
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_after_comma = true
csharp_space_before_comma = false
csharp_space_after_dot = false
csharp_space_before_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
################################################################
# .NET / C# Code Style preferences #
################################################################
# 'using' directive preferences
## IDE0065 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0065)
csharp_using_directive_placement = outside_namespace:warning
# Code-block preferences
## IDE0063 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063)
csharp_prefer_simple_using_statement = true:suggestion
## IDE0011 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0011)
csharp_prefer_braces = true:suggestion
## IDE0160 & IDE0161 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161)
csharp_style_namespace_declarations = file_scoped:warning
## IDE0200 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0200)
csharp_style_prefer_method_group_conversion = true:warning
## IDE0210 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0210)
csharp_style_prefer_top_level_statements = true:suggestion
## IDE0290 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0290)
csharp_style_prefer_primary_constructors = true:suggestion
# Expression-bodied members
## IDE0021 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0021)
csharp_style_expression_bodied_constructors = when_on_single_line:silent
## IDE0022 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022)
csharp_style_expression_bodied_methods = when_on_single_line:silent
## IDE0023 & IDE0024 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0023-ide0024)
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
## IDE0025 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0025)
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
## IDE0026 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0026)
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
## IDE0027 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0027)
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
## IDE0053 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0053)
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
## IDE0061 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0061)
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
# Expression-level preferences
## IDE0029 & IDE0030 & IDE0270 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0029-ide0030-ide0270)
dotnet_style_coalesce_expression = true:warning
## IDE0031 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0031)
dotnet_style_null_propagation = true:warning
## IDE0041 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0041)
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
## IDE0032 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032)
dotnet_style_prefer_auto_properties = true:warning
## IDE0017 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0017)
dotnet_style_object_initializer = true:suggestion
## IDE0300, IDE0301, IDE0302, IDE0303, IDE0304, IDE0305 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0300)
dotnet_style_prefer_collection_expression = true:suggestion
## IDE0028 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0028?pivots=dotnet-8-0)
dotnet_style_collection_initializer = true:suggestion
## IDE0075 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0075)
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
## IDE0045 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0045)
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
## IDE0046 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046)
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
## IDE0033 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0033)
dotnet_style_explicit_tuple_names = true:warning
## IDE0037 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0037)
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
## IDE0054 & IDE0074 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0054-ide0074)
dotnet_style_prefer_compound_assignment = true:suggestion
## IDE0071 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0071)
dotnet_style_prefer_simplified_interpolation = true:warning
## IDE0130 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130)
dotnet_style_namespace_match_folder = true:warning
## IDE0016 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0016)
csharp_style_throw_expression = true:suggestion
## IDE0150 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0150)
csharp_style_prefer_null_check_over_type_check = true:warning
## IDE0034 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0034)
csharp_prefer_simple_default_expression = true:suggestion
## IDE0039 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0039)
csharp_style_prefer_local_over_anonymous_function = true:suggestion
## IDE0056 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0056)
csharp_style_prefer_index_operator = true:suggestion
## IDE0057 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0057)
csharp_style_prefer_range_operator = true:suggestion
## IDE0090 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0090)
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
## IDE0180 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0180)
csharp_style_prefer_tuple_swap = true:warning
## IDE0230 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0230)
csharp_style_prefer_utf8_string_literals = true:warning
## IDE0018 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0018)
csharp_style_inlined_variable_declaration = true:suggestion
## IDE0042 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0042)
csharp_style_deconstructed_variable_declaration = true:suggestion
## IDE0059 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0059?pivots=lang-csharp-vb)
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
## IDE0058 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0058)
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
# Field preferences
## IDE0044 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0044)
dotnet_style_readonly_field = true:suggestion
# Language keywords vs BCL types preferences
## IDE0049 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0049)
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Modifier preferences
## IDE0036 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036)
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
## IDE0040 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0040)
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
## IDE0062 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0062)
csharp_prefer_static_local_function = true:suggestion
## IDE0250 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0250)
csharp_style_prefer_readonly_struct = true:suggestion
## IDE0251 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0251)
csharp_style_prefer_readonly_struct_member = true:suggestion
# New Line preferences
## IDE2000
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
## IDE2001
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
## IDE2002
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
## IDE2003
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
## IDE2004
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
## IDE2005
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
## IDE2006
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
# Null-checking preferences
## IDE1005 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide1005)
csharp_style_conditional_delegate_call = true:suggestion
# Parameter preferences
## IDE0060 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0060)
dotnet_code_quality_unused_parameters = all:warning
# Parantheses preferences
## IDE0047 & IDE0048 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048)
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
# Pattern matching preferences
## IDE0066 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0066)
csharp_style_prefer_switch_expression = true:suggestion
## IDE0078 & IDE0260 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0078-ide0260)
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
## IDE0020 & IDE0038 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0020-ide0038)
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
## IDE0170 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0170)
csharp_style_prefer_extended_property_pattern = true:suggestion
## IDE0083 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0083)
csharp_style_prefer_not_pattern = true:suggestion
# this. & Me. preferences
## IDE0003 & IDE0009 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0003-ide0009)
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# var preferences
## IDE0007 and IDE0008 (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0007-ide0008)
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:warning
################################################################
# .NET / C# Naming preferences #
################################################################
## If we want to enforce anything about naming style of interfaces, classes, vars etc. e.g. camelCase or snake_case, we should do it here.