|
| 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 = 4 |
| 11 | +insert_final_newline = true |
| 12 | +trim_trailing_whitespace = true |
| 13 | + |
| 14 | +# Code files |
| 15 | +[*.{cs,csx,vb,vbx}] |
| 16 | +indent_size = 4 |
| 17 | +insert_final_newline = true |
| 18 | + |
| 19 | +# XML project files |
| 20 | +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] |
| 21 | +indent_size = 2 |
| 22 | + |
| 23 | +# XML config files |
| 24 | +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] |
| 25 | +indent_size = 2 |
| 26 | + |
| 27 | +# JSON files |
| 28 | +[*.json] |
| 29 | +indent_size = 2 |
| 30 | + |
| 31 | +# YAML files |
| 32 | +[*.{yml,yaml}] |
| 33 | +indent_size = 2 |
| 34 | + |
| 35 | +# Shell scripts |
| 36 | +[*.sh] |
| 37 | +end_of_line = lf |
| 38 | + |
| 39 | +# Markdown files |
| 40 | +[*.md] |
| 41 | +trim_trailing_whitespace = false |
| 42 | + |
| 43 | +# C# files |
| 44 | +[*.cs] |
| 45 | + |
| 46 | +# New line preferences |
| 47 | +csharp_new_line_before_open_brace = all |
| 48 | +csharp_new_line_before_else = true |
| 49 | +csharp_new_line_before_catch = true |
| 50 | +csharp_new_line_before_finally = true |
| 51 | +csharp_new_line_before_members_in_object_initializers = true |
| 52 | +csharp_new_line_before_members_in_anonymous_types = true |
| 53 | +csharp_new_line_between_query_expression_clauses = true |
| 54 | + |
| 55 | +# Indentation preferences |
| 56 | +csharp_indent_case_contents = true |
| 57 | +csharp_indent_switch_labels = true |
| 58 | +csharp_indent_labels = no_change |
| 59 | +csharp_indent_block_contents = true |
| 60 | +csharp_indent_braces = false |
| 61 | +csharp_indent_case_contents_when_block = false |
| 62 | + |
| 63 | +# Space preferences |
| 64 | +csharp_space_after_cast = false |
| 65 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 66 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 67 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 68 | +csharp_space_between_parentheses = false |
| 69 | +csharp_space_before_colon_in_inheritance_clause = true |
| 70 | +csharp_space_after_colon_in_inheritance_clause = true |
| 71 | +csharp_space_around_binary_operators = before_and_after |
| 72 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 73 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 74 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 75 | + |
| 76 | +# Wrapping preferences |
| 77 | +csharp_preserve_single_line_statements = false |
| 78 | +csharp_preserve_single_line_blocks = true |
| 79 | + |
| 80 | +# Code style preferences |
| 81 | +csharp_prefer_braces = true:warning |
| 82 | +csharp_prefer_simple_using_statement = true:suggestion |
| 83 | + |
| 84 | +# Pattern matching preferences |
| 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 | + |
| 88 | +# Null checking preferences |
| 89 | +csharp_style_throw_expression = true:suggestion |
| 90 | +csharp_style_conditional_delegate_call = true:suggestion |
| 91 | + |
| 92 | +# Modifier preferences |
| 93 | +csharp_prefer_static_local_function = true:suggestion |
| 94 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion |
| 95 | + |
| 96 | +# Expression preferences |
| 97 | +csharp_prefer_simple_default_expression = true:suggestion |
| 98 | +csharp_style_pattern_local_over_anonymous_function = true:suggestion |
| 99 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 100 | + |
| 101 | +# Expression-bodied members |
| 102 | +csharp_style_expression_bodied_methods = false:none |
| 103 | +csharp_style_expression_bodied_constructors = false:none |
| 104 | +csharp_style_expression_bodied_operators = false:none |
| 105 | +csharp_style_expression_bodied_properties = true:suggestion |
| 106 | +csharp_style_expression_bodied_indexers = true:suggestion |
| 107 | +csharp_style_expression_bodied_accessors = true:suggestion |
| 108 | +csharp_style_expression_bodied_lambdas = true:suggestion |
| 109 | +csharp_style_expression_bodied_local_functions = false:none |
| 110 | + |
| 111 | +# Variable preferences |
| 112 | +csharp_style_var_for_built_in_types = false:warning |
| 113 | +csharp_style_var_when_type_is_apparent = false:warning |
| 114 | +csharp_style_var_elsewhere = false:warning |
| 115 | + |
| 116 | +# Naming conventions |
| 117 | +dotnet_naming_rule.interfaces_should_be_prefixed_with_i.severity = warning |
| 118 | +dotnet_naming_rule.interfaces_should_be_prefixed_with_i.symbols = interface |
| 119 | +dotnet_naming_rule.interfaces_should_be_prefixed_with_i.style = begins_with_i |
| 120 | + |
| 121 | +dotnet_naming_rule.types_should_be_pascal_case.severity = warning |
| 122 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 123 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
| 124 | + |
| 125 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning |
| 126 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 127 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
| 128 | + |
| 129 | +dotnet_naming_rule.private_fields_should_be_prefixed_with_underscore.severity = warning |
| 130 | +dotnet_naming_rule.private_fields_should_be_prefixed_with_underscore.symbols = private_fields |
| 131 | +dotnet_naming_rule.private_fields_should_be_prefixed_with_underscore.style = begins_with_underscore |
| 132 | + |
| 133 | +# Symbol specifications |
| 134 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 135 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 136 | +dotnet_naming_symbols.interface.required_modifiers = |
| 137 | + |
| 138 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 139 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 140 | +dotnet_naming_symbols.types.required_modifiers = |
| 141 | + |
| 142 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 143 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 144 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 145 | + |
| 146 | +dotnet_naming_symbols.private_fields.applicable_kinds = field |
| 147 | +dotnet_naming_symbols.private_fields.applicable_accessibilities = private |
| 148 | +dotnet_naming_symbols.private_fields.required_modifiers = |
| 149 | + |
| 150 | +# Naming styles |
| 151 | +dotnet_naming_style.pascal_case.required_prefix = |
| 152 | +dotnet_naming_style.pascal_case.required_suffix = |
| 153 | +dotnet_naming_style.pascal_case.word_separator = |
| 154 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 155 | + |
| 156 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 157 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 158 | +dotnet_naming_style.begins_with_i.word_separator = |
| 159 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
| 160 | + |
| 161 | +dotnet_naming_style.begins_with_underscore.required_prefix = _ |
| 162 | +dotnet_naming_style.begins_with_underscore.required_suffix = |
| 163 | +dotnet_naming_style.begins_with_underscore.word_separator = |
| 164 | +dotnet_naming_style.begins_with_underscore.capitalization = camel_case |
| 165 | + |
| 166 | +# .NET code quality |
| 167 | +dotnet_code_quality_unused_parameters = all:suggestion |
| 168 | + |
| 169 | +# .NET style |
| 170 | +dotnet_sort_system_directives_first = true |
| 171 | +dotnet_separate_import_directive_groups = false |
| 172 | + |
| 173 | +# Organize usings |
| 174 | +dotnet_sort_system_directives_first = true |
| 175 | + |
| 176 | +# this. preferences |
| 177 | +dotnet_style_qualification_for_field = false:warning |
| 178 | +dotnet_style_qualification_for_property = false:warning |
| 179 | +dotnet_style_qualification_for_method = false:warning |
| 180 | +dotnet_style_qualification_for_event = false:warning |
| 181 | + |
| 182 | +# Language keywords vs BCL types preferences |
| 183 | +dotnet_style_predefined_type_for_locals_parameters_members = true:warning |
| 184 | +dotnet_style_predefined_type_for_member_access = true:warning |
| 185 | + |
| 186 | +# Parentheses preferences |
| 187 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent |
| 188 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent |
| 189 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent |
| 190 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent |
| 191 | + |
| 192 | +# Expression-level preferences |
| 193 | +dotnet_style_object_initializer = true:suggestion |
| 194 | +dotnet_style_collection_initializer = true:suggestion |
| 195 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 196 | +dotnet_style_prefer_inferred_tuple_names = true:suggestion |
| 197 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
| 198 | +dotnet_style_prefer_auto_properties = true:suggestion |
| 199 | +dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
| 200 | +dotnet_style_prefer_conditional_expression_over_return = true:silent |
| 201 | +dotnet_style_prefer_compound_assignment = true:suggestion |
| 202 | + |
| 203 | +# Null-checking preferences |
| 204 | +dotnet_style_coalesce_expression = true:suggestion |
| 205 | +dotnet_style_null_propagation = true:suggestion |
| 206 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 207 | + |
| 208 | +# File header preferences |
| 209 | +# file_header_template = unset |
| 210 | + |
| 211 | +# Roslynator |
| 212 | +roslynator_accessibility_modifiers = explicit |
| 213 | +roslynator_enum_has_flag_style = method |
0 commit comments