|
| 1 | +; Visual Studio Extension : http://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328 |
| 2 | +; See http://editorconfig.org/ for more informations |
| 3 | +; Top-most EditorConfig file |
| 4 | +root = true |
| 5 | + |
| 6 | +; 4-column space indentation |
| 7 | +[*] |
| 8 | +indent_style = space |
| 9 | +indent_size = 4 |
| 10 | +trim_trailing_whitespace = true |
| 11 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 12 | +tab_width = 4 |
| 13 | +end_of_line = crlf |
| 14 | +dotnet_style_coalesce_expression = true:suggestion |
| 15 | +dotnet_style_null_propagation = true:suggestion |
| 16 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 17 | +dotnet_style_prefer_auto_properties = true:silent |
| 18 | +dotnet_style_object_initializer = true:suggestion |
| 19 | +dotnet_style_prefer_collection_expression = true:suggestion |
| 20 | +dotnet_style_collection_initializer = true:suggestion |
| 21 | +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion |
| 22 | +dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
| 23 | +dotnet_style_prefer_conditional_expression_over_return = true:silent |
| 24 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 25 | +dotnet_style_prefer_inferred_tuple_names = true:suggestion |
| 26 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
| 27 | +dotnet_style_prefer_compound_assignment = true:suggestion |
| 28 | +dotnet_style_prefer_simplified_interpolation = true:suggestion |
| 29 | +dotnet_style_namespace_match_folder = true:suggestion |
| 30 | +dotnet_style_readonly_field = true:suggestion |
| 31 | +dotnet_style_predefined_type_for_locals_parameters_members = true:none |
| 32 | +dotnet_style_predefined_type_for_member_access = true:none |
| 33 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members:none |
| 34 | +dotnet_style_allow_multiple_blank_lines_experimental = true:silent |
| 35 | +dotnet_style_allow_statement_immediately_after_block_experimental = true:silent |
| 36 | +dotnet_code_quality_unused_parameters = all:suggestion |
| 37 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none |
| 38 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:none |
| 39 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:none |
| 40 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none |
| 41 | +dotnet_style_qualification_for_field = false:none |
| 42 | +dotnet_style_qualification_for_property = false:none |
| 43 | +dotnet_style_qualification_for_method = false:none |
| 44 | +dotnet_style_qualification_for_event = false:none |
| 45 | + |
| 46 | +[*.{csproj,vcxproj}] |
| 47 | +indent_style = space |
| 48 | +indent_size = 2 |
| 49 | +insert_final_newline = false |
| 50 | + |
| 51 | +[*.{props,targets}] |
| 52 | +indent_size = 2 |
| 53 | + |
| 54 | +[*.Designer.cs] |
| 55 | +trim_trailing_whitespace = false |
| 56 | + |
| 57 | +[*.{xml,config,nuspec,xslt,wxs}] |
| 58 | +indent_style = space |
| 59 | +indent_size = 2 |
| 60 | +trim_trailing_whitespace = true |
| 61 | + |
| 62 | +[*.{patch,diff}] |
| 63 | +trim_trailing_whitespace = false |
| 64 | + |
| 65 | +[*.blame] |
| 66 | +trim_trailing_whitespace = false |
| 67 | + |
| 68 | +[*.resx] |
| 69 | +indent_style = space |
| 70 | +indent_size = 2 |
| 71 | +trim_trailing_whitespace = false |
| 72 | + |
| 73 | +# C# files |
| 74 | +[*.cs] |
| 75 | + |
| 76 | +#### Core EditorConfig Options #### |
| 77 | + |
| 78 | +# New line preferences |
| 79 | +insert_final_newline = true |
| 80 | + |
| 81 | +#### .NET Coding Conventions #### |
| 82 | + |
| 83 | +# Organize usings |
| 84 | +dotnet_separate_import_directive_groups = false |
| 85 | +dotnet_sort_system_directives_first = true |
| 86 | + |
| 87 | +# this. and Me. preferences |
| 88 | +dotnet_style_qualification_for_event = false:none |
| 89 | +dotnet_style_qualification_for_field = false:none |
| 90 | +dotnet_style_qualification_for_method = false:none |
| 91 | +dotnet_style_qualification_for_property = false:none |
| 92 | + |
| 93 | +# Language keywords vs BCL types preferences |
| 94 | +dotnet_style_predefined_type_for_locals_parameters_members = true:none |
| 95 | +dotnet_style_predefined_type_for_member_access = true:none |
| 96 | + |
| 97 | +# Parentheses preferences |
| 98 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:none |
| 99 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none |
| 100 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:none |
| 101 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none |
| 102 | + |
| 103 | +# Modifier preferences |
| 104 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members:none |
| 105 | + |
| 106 | +# Expression-level preferences |
| 107 | +dotnet_style_coalesce_expression = true:suggestion |
| 108 | +dotnet_style_collection_initializer = true:suggestion |
| 109 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 110 | +dotnet_style_null_propagation = true:suggestion |
| 111 | +dotnet_style_object_initializer = true:suggestion |
| 112 | +dotnet_style_prefer_auto_properties = true:silent |
| 113 | +dotnet_style_prefer_compound_assignment = true:suggestion |
| 114 | +dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
| 115 | +dotnet_style_prefer_conditional_expression_over_return = true:silent |
| 116 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
| 117 | +dotnet_style_prefer_inferred_tuple_names = true:suggestion |
| 118 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 119 | + |
| 120 | +# Field preferences |
| 121 | +dotnet_style_readonly_field = true:suggestion |
| 122 | + |
| 123 | +# Parameter preferences |
| 124 | +dotnet_code_quality_unused_parameters = all:suggestion |
| 125 | + |
| 126 | +#### C# Coding Conventions #### |
| 127 | + |
| 128 | +# Avoid var |
| 129 | +csharp_style_var_for_built_in_types = false:warning |
| 130 | +csharp_style_var_when_type_is_apparent = false:warning |
| 131 | +csharp_style_var_elsewhere = false:warning |
| 132 | + |
| 133 | +# Expression-bodied members |
| 134 | +csharp_style_expression_bodied_accessors = true:silent |
| 135 | +csharp_style_expression_bodied_constructors = false:silent |
| 136 | +csharp_style_expression_bodied_indexers = true:silent |
| 137 | +csharp_style_expression_bodied_lambdas = true:silent |
| 138 | +csharp_style_expression_bodied_local_functions = false:silent |
| 139 | +csharp_style_expression_bodied_methods = false:silent |
| 140 | +csharp_style_expression_bodied_operators = false:silent |
| 141 | +csharp_style_expression_bodied_properties = false:silent |
| 142 | + |
| 143 | +# Pattern matching preferences |
| 144 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
| 145 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
| 146 | +csharp_style_prefer_switch_expression = true:silent |
| 147 | + |
| 148 | +# Null-checking preferences |
| 149 | +csharp_style_conditional_delegate_call = true:suggestion |
| 150 | + |
| 151 | +# Modifier preferences |
| 152 | +csharp_prefer_static_local_function = true:suggestion |
| 153 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async |
| 154 | + |
| 155 | +# Code-block preferences |
| 156 | +csharp_prefer_braces = true:none |
| 157 | +csharp_prefer_simple_using_statement = true:suggestion |
| 158 | + |
| 159 | +# Expression-level preferences |
| 160 | +csharp_prefer_simple_default_expression = true:suggestion |
| 161 | +csharp_style_deconstructed_variable_declaration = true:suggestion |
| 162 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 163 | +csharp_style_pattern_local_over_anonymous_function = true:suggestion |
| 164 | +csharp_style_prefer_index_operator = true:suggestion |
| 165 | +csharp_style_prefer_range_operator = true:suggestion |
| 166 | +csharp_style_throw_expression = true:suggestion |
| 167 | +csharp_style_unused_value_assignment_preference = discard_variable:suggestion |
| 168 | +csharp_style_unused_value_expression_statement_preference = discard_variable:silent |
| 169 | + |
| 170 | +# 'using' directive preferences |
| 171 | +csharp_using_directive_placement = outside_namespace:none |
| 172 | + |
| 173 | +# Use new(...) |
| 174 | +dotnet_diagnostic.IDE0090.severity = warning |
| 175 | + |
| 176 | +#### C# Formatting Rules #### |
| 177 | + |
| 178 | +# New line preferences |
| 179 | +csharp_new_line_before_catch = true |
| 180 | +csharp_new_line_before_else = true |
| 181 | +csharp_new_line_before_finally = true |
| 182 | +csharp_new_line_before_members_in_anonymous_types = true |
| 183 | +csharp_new_line_before_members_in_object_initializers = true |
| 184 | +csharp_new_line_before_open_brace = all |
| 185 | +csharp_new_line_between_query_expression_clauses = true |
| 186 | + |
| 187 | +# Indentation preferences |
| 188 | +csharp_indent_block_contents = true |
| 189 | +csharp_indent_braces = false |
| 190 | +csharp_indent_case_contents = true |
| 191 | +csharp_indent_case_contents_when_block = true |
| 192 | +csharp_indent_labels = no_change |
| 193 | +csharp_indent_switch_labels = true |
| 194 | + |
| 195 | +# Space preferences |
| 196 | +csharp_space_after_cast = false |
| 197 | +csharp_space_after_colon_in_inheritance_clause = true |
| 198 | +csharp_space_after_comma = true |
| 199 | +csharp_space_after_dot = false |
| 200 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 201 | +csharp_space_after_semicolon_in_for_statement = true |
| 202 | +csharp_space_around_binary_operators = before_and_after |
| 203 | +csharp_space_around_declaration_statements = false |
| 204 | +csharp_space_before_colon_in_inheritance_clause = true |
| 205 | +csharp_space_before_comma = false |
| 206 | +csharp_space_before_dot = false |
| 207 | +csharp_space_before_open_square_brackets = false |
| 208 | +csharp_space_before_semicolon_in_for_statement = false |
| 209 | +csharp_space_between_empty_square_brackets = false |
| 210 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 211 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 212 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 213 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 214 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
| 215 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 216 | +csharp_space_between_parentheses = false |
| 217 | +csharp_space_between_square_brackets = false |
| 218 | + |
| 219 | +# Wrapping preferences |
| 220 | +csharp_preserve_single_line_blocks = true |
| 221 | +csharp_preserve_single_line_statements = true |
| 222 | + |
| 223 | +#### Naming styles #### |
| 224 | + |
| 225 | +# Naming rules |
| 226 | + |
| 227 | +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion |
| 228 | +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
| 229 | +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
| 230 | + |
| 231 | +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion |
| 232 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 233 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
| 234 | + |
| 235 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion |
| 236 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 237 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
| 238 | + |
| 239 | +dotnet_naming_rule.private_members_with_underscore.symbols = private_fields |
| 240 | +dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore |
| 241 | +dotnet_naming_rule.private_members_with_underscore.severity = suggestion |
| 242 | + |
| 243 | +dotnet_naming_symbols.private_fields.applicable_kinds = field |
| 244 | +dotnet_naming_symbols.private_fields.applicable_accessibilities = private |
| 245 | + |
| 246 | +dotnet_naming_style.prefix_underscore.capitalization = camel_case |
| 247 | +dotnet_naming_style.prefix_underscore.required_prefix = _ |
| 248 | + |
| 249 | +# Symbol specifications |
| 250 | + |
| 251 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 252 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 253 | +dotnet_naming_symbols.interface.required_modifiers = |
| 254 | + |
| 255 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 256 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 257 | +dotnet_naming_symbols.types.required_modifiers = |
| 258 | + |
| 259 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 260 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 261 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 262 | + |
| 263 | +# Naming styles |
| 264 | + |
| 265 | +dotnet_naming_style.pascal_case.required_prefix = |
| 266 | +dotnet_naming_style.pascal_case.required_suffix = |
| 267 | +dotnet_naming_style.pascal_case.word_separator = |
| 268 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 269 | + |
| 270 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 271 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 272 | +dotnet_naming_style.begins_with_i.word_separator = |
| 273 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
| 274 | + |
| 275 | +# SA1135: Using directives should be qualified |
| 276 | +dotnet_diagnostic.SA1135.severity = none |
| 277 | + |
| 278 | +# SA1629: Documentation text should end with a period |
| 279 | +dotnet_diagnostic.SA1629.severity = none |
| 280 | +csharp_style_namespace_declarations = block_scoped:silent |
| 281 | +csharp_style_prefer_method_group_conversion = true:silent |
| 282 | +csharp_style_prefer_top_level_statements = true:silent |
| 283 | +csharp_style_prefer_primary_constructors = true:suggestion |
| 284 | +csharp_style_prefer_null_check_over_type_check = true:suggestion |
| 285 | +csharp_style_prefer_local_over_anonymous_function = true:suggestion |
| 286 | +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion |
| 287 | +csharp_style_prefer_tuple_swap = true:suggestion |
| 288 | +csharp_style_prefer_utf8_string_literals = true:suggestion |
| 289 | +csharp_style_prefer_readonly_struct = true:suggestion |
| 290 | +csharp_style_prefer_readonly_struct_member = true:suggestion |
| 291 | +csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent |
| 292 | +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent |
| 293 | +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent |
| 294 | +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent |
| 295 | +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent |
| 296 | +csharp_style_prefer_pattern_matching = true:silent |
| 297 | +csharp_style_prefer_not_pattern = true:suggestion |
| 298 | +csharp_style_prefer_extended_property_pattern = true:suggestion |
| 299 | +csharp_prefer_system_threading_lock = true:suggestion |
| 300 | + |
| 301 | +# WFO1000: A property should determine its property content serialization with the DesignerSerializationVisibilityAttribute, DefaultValueAttribute or the ShouldSerializeProperty method |
| 302 | +# Silent for now, see https://github.com/dotnet/winforms/issues/12476 |
| 303 | +dotnet_diagnostic.WFO1000.severity = silent |
| 304 | + |
| 305 | +# WFO5001: Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. |
| 306 | +dotnet_diagnostic.WFO5001.severity = silent |
0 commit comments