|
| 1 | +# EditorConfig is awesome: https://EditorConfig.org |
| 2 | + |
| 3 | +# top-most EditorConfig file |
| 4 | +root = true |
| 5 | + |
| 6 | +# All files |
| 7 | +[*] |
| 8 | +charset = utf-8 |
| 9 | +indent_style = space |
| 10 | +indent_size = 2 |
| 11 | +insert_final_newline = true |
| 12 | +trim_trailing_whitespace = true |
| 13 | + |
| 14 | +# Code files |
| 15 | +[*.{cs,csx,vb,vbx}] |
| 16 | +indent_size = 4 |
| 17 | + |
| 18 | +# XML project files |
| 19 | +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] |
| 20 | +indent_size = 2 |
| 21 | + |
| 22 | +# XML config files |
| 23 | +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] |
| 24 | +indent_size = 2 |
| 25 | + |
| 26 | +# JSON files |
| 27 | +[*.json] |
| 28 | +indent_size = 2 |
| 29 | + |
| 30 | +# YAML files |
| 31 | +[*.{yml,yaml}] |
| 32 | +indent_size = 2 |
| 33 | + |
| 34 | +# Shell scripts |
| 35 | +[*.sh] |
| 36 | +end_of_line = lf |
| 37 | + |
| 38 | +# Markdown files |
| 39 | +[*.md] |
| 40 | +trim_trailing_whitespace = false |
| 41 | + |
| 42 | +# Dotnet code style settings: |
| 43 | +[*.{cs,vb}] |
| 44 | + |
| 45 | +# Sort using and Import directives with System.* appearing first |
| 46 | +dotnet_sort_system_directives_first = true |
| 47 | +dotnet_separate_import_directive_groups = false |
| 48 | + |
| 49 | +# Avoid "this." and "Me." if not necessary |
| 50 | +dotnet_style_qualification_for_field = false:warning |
| 51 | +dotnet_style_qualification_for_property = false:warning |
| 52 | +dotnet_style_qualification_for_method = false:warning |
| 53 | +dotnet_style_qualification_for_event = false:warning |
| 54 | + |
| 55 | +# Use language keywords instead of framework type names for type references |
| 56 | +dotnet_style_predefined_type_for_locals_parameters_members = true:warning |
| 57 | +dotnet_style_predefined_type_for_member_access = true:warning |
| 58 | + |
| 59 | +# Suggest more modern language features when available |
| 60 | +dotnet_style_object_initializer = true:suggestion |
| 61 | +dotnet_style_collection_initializer = true:suggestion |
| 62 | +dotnet_style_coalesce_expression = true:suggestion |
| 63 | +dotnet_style_null_propagation = true:suggestion |
| 64 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 65 | + |
| 66 | +# CSharp code style settings: |
| 67 | +[*.cs] |
| 68 | + |
| 69 | +# Prefer "var" everywhere |
| 70 | +csharp_style_var_for_built_in_types = true:suggestion |
| 71 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 72 | +csharp_style_var_elsewhere = true:suggestion |
| 73 | + |
| 74 | +# Prefer method-like constructs to have a block body |
| 75 | +csharp_style_expression_bodied_methods = false:none |
| 76 | +csharp_style_expression_bodied_constructors = false:none |
| 77 | +csharp_style_expression_bodied_operators = false:none |
| 78 | + |
| 79 | +# Prefer property-like constructs to have an expression-body |
| 80 | +csharp_style_expression_bodied_properties = true:suggestion |
| 81 | +csharp_style_expression_bodied_indexers = true:suggestion |
| 82 | +csharp_style_expression_bodied_accessors = true:suggestion |
| 83 | + |
| 84 | +# Suggest more modern language features when available |
| 85 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
| 86 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
| 87 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 88 | +csharp_style_throw_expression = true:suggestion |
| 89 | +csharp_style_conditional_delegate_call = true:suggestion |
| 90 | + |
| 91 | +# Newline settings |
| 92 | +csharp_new_line_before_open_brace = all |
| 93 | +csharp_new_line_before_else = true |
| 94 | +csharp_new_line_before_catch = true |
| 95 | +csharp_new_line_before_finally = true |
| 96 | +csharp_new_line_before_members_in_object_initializers = true |
| 97 | +csharp_new_line_before_members_in_anonymous_types = true |
| 98 | +csharp_new_line_between_query_expression_clauses = true |
| 99 | + |
| 100 | +# Indentation preferences |
| 101 | +csharp_indent_block_contents = true |
| 102 | +csharp_indent_braces = false |
| 103 | +csharp_indent_case_contents = true |
| 104 | +csharp_indent_case_contents_when_block = false |
| 105 | +csharp_indent_switch_labels = true |
| 106 | +csharp_indent_labels = one_less_than_current |
| 107 | + |
| 108 | +# Space preferences |
| 109 | +csharp_space_after_cast = false |
| 110 | +csharp_space_after_colon_in_inheritance_clause = true |
| 111 | +csharp_space_after_comma = true |
| 112 | +csharp_space_after_dot = false |
| 113 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 114 | +csharp_space_after_semicolon_in_for_statement = true |
| 115 | +csharp_space_around_binary_operators = before_and_after |
| 116 | +csharp_space_around_declaration_statements = false |
| 117 | +csharp_space_before_colon_in_inheritance_clause = true |
| 118 | +csharp_space_before_comma = false |
| 119 | +csharp_space_before_dot = false |
| 120 | +csharp_space_before_open_square_brackets = false |
| 121 | +csharp_space_before_semicolon_in_for_statement = false |
| 122 | +csharp_space_between_empty_square_brackets = false |
| 123 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 124 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 125 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 126 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 127 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
| 128 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 129 | +csharp_space_between_parentheses = false |
| 130 | +csharp_space_between_square_brackets = false |
| 131 | + |
| 132 | +# Wrapping preferences |
| 133 | +csharp_preserve_single_line_blocks = true |
| 134 | +csharp_preserve_single_line_statements = true |
| 135 | + |
| 136 | +# Naming conventions |
| 137 | +[*.{cs,vb}] |
| 138 | + |
| 139 | +# Naming rules |
| 140 | +dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning |
| 141 | +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
| 142 | +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
| 143 | + |
| 144 | +dotnet_naming_rule.types_should_be_pascal_case.severity = warning |
| 145 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 146 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
| 147 | + |
| 148 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning |
| 149 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 150 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
| 151 | + |
| 152 | +# Symbol specifications |
| 153 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 154 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 155 | +dotnet_naming_symbols.interface.required_modifiers = |
| 156 | + |
| 157 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 158 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 159 | +dotnet_naming_symbols.types.required_modifiers = |
| 160 | + |
| 161 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 162 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 163 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 164 | + |
| 165 | +# Naming styles |
| 166 | +dotnet_naming_style.pascal_case.required_prefix = |
| 167 | +dotnet_naming_style.pascal_case.required_suffix = |
| 168 | +dotnet_naming_style.pascal_case.word_separator = |
| 169 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 170 | + |
| 171 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 172 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 173 | +dotnet_naming_style.begins_with_i.word_separator = |
| 174 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
0 commit comments