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