|
| 1 | + |
| 2 | +# EditorConfig is awesome:http://EditorConfig.org |
| 3 | + |
| 4 | +# top-most EditorConfig file |
| 5 | +root = true |
| 6 | + |
| 7 | +# Standardize on CR/LF (Windows) line endings |
| 8 | +# Don't use tabs for indentation. |
| 9 | +[*] |
| 10 | +end_of_line = crlf |
| 11 | +indent_style = space |
| 12 | +# (Please don't specify an indent_size here; that has too many unintended consequences.) |
| 13 | + |
| 14 | +[*.yml] |
| 15 | +indent_style = space |
| 16 | +indent_size = 2 |
| 17 | + |
| 18 | +# Code files |
| 19 | +[*.{cs,csx,vb,vbx}] |
| 20 | +indent_size = 4 |
| 21 | +insert_final_newline = true |
| 22 | +charset = utf-8-bom |
| 23 | + |
| 24 | +# Xml project files |
| 25 | +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] |
| 26 | +indent_size = 4 |
| 27 | + |
| 28 | +# Xml config files |
| 29 | +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] |
| 30 | +indent_size = 2 |
| 31 | + |
| 32 | +# JSON files |
| 33 | +[*.json] |
| 34 | +indent_size = 2 |
| 35 | + |
| 36 | +[*.{sh}] |
| 37 | +end_of_line = lf |
| 38 | +indent_size = 2 |
| 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 | + |
| 45 | +# Prefer "var" everywhere |
| 46 | +dotnet_style_qualification_for_field = true:suggestion |
| 47 | +dotnet_style_qualification_for_property = true:suggestion |
| 48 | +dotnet_style_qualification_for_method = true:suggestion |
| 49 | +dotnet_style_qualification_for_event = true:suggestion |
| 50 | + |
| 51 | +# Use language keywords instead of framework type names for type references |
| 52 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 53 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 54 | + |
| 55 | +# Suggest more modern language features when available |
| 56 | +dotnet_style_object_initializer = true:suggestion |
| 57 | +dotnet_style_collection_initializer = true:suggestion |
| 58 | +dotnet_style_coalesce_expression = true:suggestion |
| 59 | +dotnet_style_null_propagation = true:suggestion |
| 60 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 61 | + |
| 62 | +# Non-private static fields are PascalCase |
| 63 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion |
| 64 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields |
| 65 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style |
| 66 | + |
| 67 | +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field |
| 68 | +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected |
| 69 | +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static |
| 70 | + |
| 71 | +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case |
| 72 | + |
| 73 | +# Constants are PascalCase |
| 74 | +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion |
| 75 | +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants |
| 76 | +dotnet_naming_rule.constants_should_be_pascal_case.style = non_private_static_field_style |
| 77 | + |
| 78 | +dotnet_naming_symbols.constants.applicable_kinds = field, local |
| 79 | +dotnet_naming_symbols.constants.required_modifiers = const |
| 80 | + |
| 81 | +dotnet_naming_style.constant_style.capitalization = pascal_case |
| 82 | + |
| 83 | +# Static fields are camelCase and start with no prefix |
| 84 | +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion |
| 85 | +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields |
| 86 | +dotnet_naming_rule.static_fields_should_be_camel_case.style = camel_case_style |
| 87 | + |
| 88 | +dotnet_naming_symbols.static_fields.applicable_kinds = field |
| 89 | +dotnet_naming_symbols.static_fields.required_modifiers = static |
| 90 | + |
| 91 | +dotnet_naming_style.static_field_style.capitalization = camel_case |
| 92 | + |
| 93 | +# Instance fields are camelCase and start with no prefix |
| 94 | +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion |
| 95 | +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields |
| 96 | +dotnet_naming_rule.instance_fields_should_be_camel_case.style = camel_case_style |
| 97 | + |
| 98 | +dotnet_naming_symbols.instance_fields.applicable_kinds = field |
| 99 | + |
| 100 | +dotnet_naming_style.instance_field_style.capitalization = camel_case |
| 101 | + |
| 102 | +# Locals and parameters are camelCase |
| 103 | +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion |
| 104 | +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters |
| 105 | +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style |
| 106 | + |
| 107 | +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local |
| 108 | + |
| 109 | +dotnet_naming_style.camel_case_style.capitalization = camel_case |
| 110 | + |
| 111 | +# Local functions are PascalCase |
| 112 | +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion |
| 113 | +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions |
| 114 | +dotnet_naming_rule.local_functions_should_be_pascal_case.style = non_private_static_field_style |
| 115 | + |
| 116 | +dotnet_naming_symbols.local_functions.applicable_kinds = local_function |
| 117 | + |
| 118 | +dotnet_naming_style.local_function_style.capitalization = pascal_case |
| 119 | + |
| 120 | +# By default, name items with PascalCase |
| 121 | +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion |
| 122 | +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members |
| 123 | +dotnet_naming_rule.members_should_be_pascal_case.style = non_private_static_field_style |
| 124 | + |
| 125 | +dotnet_naming_symbols.all_members.applicable_kinds = * |
| 126 | + |
| 127 | +dotnet_naming_style.pascal_case_style.capitalization = pascal_case |
| 128 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 129 | +tab_width = 4 |
| 130 | + |
| 131 | +# CSharp code style settings: |
| 132 | +[*.cs] |
| 133 | +# Indentation preferences |
| 134 | +csharp_indent_block_contents = true |
| 135 | +csharp_indent_braces = false |
| 136 | +csharp_indent_case_contents = true |
| 137 | +csharp_indent_case_contents_when_block = true |
| 138 | +csharp_indent_switch_labels = true |
| 139 | +csharp_indent_labels = flush_left |
| 140 | + |
| 141 | +# Prefer "var" everywhere |
| 142 | +csharp_style_var_for_built_in_types = true:suggestion |
| 143 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 144 | +csharp_style_var_elsewhere = true:suggestion |
| 145 | + |
| 146 | +# Prefer method-like constructs to have a block body |
| 147 | +csharp_style_expression_bodied_methods = false:none |
| 148 | +csharp_style_expression_bodied_constructors = false:none |
| 149 | +csharp_style_expression_bodied_operators = false:none |
| 150 | + |
| 151 | +# Prefer property-like constructs to have an expression-body |
| 152 | +csharp_style_expression_bodied_properties = true:none |
| 153 | +csharp_style_expression_bodied_indexers = true:none |
| 154 | +csharp_style_expression_bodied_accessors = true:none |
| 155 | + |
| 156 | +# Suggest more modern language features when available |
| 157 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
| 158 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
| 159 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 160 | +csharp_style_throw_expression = true:suggestion |
| 161 | +csharp_style_conditional_delegate_call = true:suggestion |
| 162 | + |
| 163 | +# Newline settings |
| 164 | +csharp_new_line_before_open_brace = all |
| 165 | +csharp_new_line_before_else = true |
| 166 | +csharp_new_line_before_catch = true |
| 167 | +csharp_new_line_before_finally = true |
| 168 | +csharp_new_line_before_members_in_object_initializers = true |
| 169 | +csharp_new_line_before_members_in_anonymous_types = true |
| 170 | +csharp_new_line_between_query_expression_clauses = true |
| 171 | + |
| 172 | +# Spacing |
| 173 | +csharp_space_after_cast = false |
| 174 | +csharp_space_after_colon_in_inheritance_clause = true |
| 175 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 176 | +csharp_space_around_binary_operators = before_and_after |
| 177 | +csharp_space_before_colon_in_inheritance_clause = true |
| 178 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 179 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 180 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 181 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 182 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 183 | +csharp_space_between_parentheses = false |
| 184 | + |
| 185 | +# Blocks are allowed |
| 186 | +csharp_prefer_braces = true:silent |
| 187 | +csharp_preserve_single_line_blocks = true |
| 188 | +csharp_preserve_single_line_statements = true |
| 189 | + |
| 190 | +# ReSharper properties |
| 191 | +resharper_instance_members_qualify_members = field, property, event, method |
| 192 | +resharper_csharp_wrap_arguments_style = chop_if_long |
| 193 | +resharper_csharp_wrap_parameters_style = chop_if_long |
| 194 | +csharp_using_directive_placement = outside_namespace:silent |
| 195 | +csharp_prefer_simple_using_statement = true:suggestion |
| 196 | +csharp_style_namespace_declarations = block_scoped:silent |
| 197 | +csharp_style_prefer_method_group_conversion = true:silent |
| 198 | +csharp_style_prefer_top_level_statements = true:silent |
| 199 | +csharp_style_prefer_primary_constructors = true:suggestion |
| 200 | +csharp_style_expression_bodied_lambdas = true:silent |
| 201 | +csharp_style_expression_bodied_local_functions = false:silent |
0 commit comments