|
| 1 | +root=true |
| 2 | +# EditorConfig helps developers define and maintain consistent |
| 3 | +# coding styles between different editors and IDEs |
| 4 | +# editorconfig.org |
| 5 | + |
| 6 | + |
| 7 | +[*] |
| 8 | +end_of_line=crlf |
| 9 | +charset=utf-8 |
| 10 | +trim_trailing_whitespace=true |
| 11 | +insert_final_newline=true |
| 12 | + |
| 13 | +# Microsoft .NET properties |
| 14 | +csharp_new_line_before_catch=false |
| 15 | +csharp_new_line_before_else=false |
| 16 | +csharp_new_line_before_finally=false |
| 17 | +csharp_new_line_before_members_in_object_initializers=true |
| 18 | +csharp_new_line_before_open_brace=none |
| 19 | +csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion |
| 20 | +csharp_space_after_keywords_in_control_flow_statements=false |
| 21 | +csharp_style_namespace_declarations=file_scoped:error |
| 22 | +csharp_style_var_elsewhere=true:suggestion |
| 23 | +csharp_style_var_for_built_in_types=true:suggestion |
| 24 | +csharp_style_var_when_type_is_apparent=true:suggestion |
| 25 | +dotnet_naming_rule.private_constants_rule.severity=suggestion |
| 26 | +dotnet_naming_rule.private_constants_rule.style=lower_camel_case_style |
| 27 | +dotnet_naming_rule.private_constants_rule.symbols=private_constants_symbols |
| 28 | +dotnet_naming_rule.private_static_readonly_rule.severity=suggestion |
| 29 | +dotnet_naming_rule.private_static_readonly_rule.style=lower_camel_case_style |
| 30 | +dotnet_naming_rule.private_static_readonly_rule.symbols=private_static_readonly_symbols |
| 31 | +dotnet_naming_style.lower_camel_case_style.capitalization=camel_case |
| 32 | +dotnet_naming_style.lower_camel_case_style.required_prefix=_ |
| 33 | +dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities=private |
| 34 | +dotnet_naming_symbols.private_constants_symbols.applicable_kinds=field |
| 35 | +dotnet_naming_symbols.private_constants_symbols.required_modifiers=const |
| 36 | +dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities=private |
| 37 | +dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds=field |
| 38 | +dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers=static,readonly |
| 39 | +dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none |
| 40 | +dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none |
| 41 | +dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none |
| 42 | +dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion |
| 43 | +dotnet_style_predefined_type_for_member_access=true:suggestion |
| 44 | +dotnet_style_qualification_for_event=false:suggestion |
| 45 | +dotnet_style_qualification_for_field=false:suggestion |
| 46 | +dotnet_style_qualification_for_method=false:suggestion |
| 47 | +dotnet_style_qualification_for_property=false:suggestion |
| 48 | +dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion |
| 49 | + |
| 50 | +# Organize usings |
| 51 | +dotnet_separate_import_directive_groups = false |
| 52 | +dotnet_sort_system_directives_first = true |
| 53 | +file_header_template = unset |
| 54 | + |
| 55 | +# 'using' directive preferences |
| 56 | +csharp_using_directive_placement = outside_namespace:warning |
| 57 | + |
| 58 | +# Indentation preferences |
| 59 | +csharp_indent_block_contents = true |
| 60 | +csharp_indent_braces = false |
| 61 | +csharp_indent_case_contents = true |
| 62 | +csharp_indent_case_contents_when_block = true |
| 63 | +csharp_indent_labels = one_less_than_current |
| 64 | +csharp_indent_switch_labels = true |
| 65 | + |
| 66 | +# Space preferences |
| 67 | +csharp_space_after_cast = false |
| 68 | +csharp_space_after_colon_in_inheritance_clause = true |
| 69 | +csharp_space_after_comma = true |
| 70 | +csharp_space_after_dot = false |
| 71 | +csharp_space_after_keywords_in_control_flow_statements = false |
| 72 | +csharp_space_after_semicolon_in_for_statement = true |
| 73 | +csharp_space_around_binary_operators = before_and_after |
| 74 | +csharp_space_around_declaration_statements = false |
| 75 | +csharp_space_before_colon_in_inheritance_clause = true |
| 76 | +csharp_space_before_comma = false |
| 77 | +csharp_space_before_dot = false |
| 78 | +csharp_space_before_open_square_brackets = false |
| 79 | +csharp_space_before_semicolon_in_for_statement = false |
| 80 | +csharp_space_between_empty_square_brackets = false |
| 81 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 82 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 83 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 84 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 85 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
| 86 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 87 | +csharp_space_between_parentheses = false |
| 88 | +csharp_space_between_square_brackets = false |
| 89 | + |
| 90 | +# ReSharper properties |
| 91 | +resharper_allow_comment_after_lbrace=true |
| 92 | +resharper_brace_style=end_of_line |
| 93 | +resharper_csharp_wrap_lines=false |
| 94 | +resharper_enforce_line_ending_style=true |
| 95 | +resharper_new_line_before_catch=false |
| 96 | +resharper_new_line_before_else=false |
| 97 | +resharper_new_line_before_finally=false |
| 98 | +resharper_csharp_namespace_body=file_scoped |
| 99 | + |
| 100 | +# ReSharper inspection severities |
| 101 | +resharper_arrange_redundant_parentheses_highlighting=hint |
| 102 | +resharper_arrange_this_qualifier_highlighting=hint |
| 103 | +resharper_arrange_type_member_modifiers_highlighting=hint |
| 104 | +resharper_arrange_type_modifiers_highlighting=hint |
| 105 | +resharper_built_in_type_reference_style_for_member_access_highlighting=hint |
| 106 | +resharper_built_in_type_reference_style_highlighting=hint |
| 107 | +resharper_comment_typo_highlighting=none |
| 108 | +resharper_identifier_typo_highlighting=none |
| 109 | +resharper_inconsistent_naming_highlighting=suggestion |
| 110 | +resharper_localizable_element_highlighting=none |
| 111 | +resharper_redundant_base_qualifier_highlighting=warning |
| 112 | +resharper_string_literal_typo_highlighting=none |
| 113 | +resharper_suggest_var_or_type_built_in_types_highlighting=hint |
| 114 | +resharper_suggest_var_or_type_elsewhere_highlighting=hint |
| 115 | +resharper_suggest_var_or_type_simple_types_highlighting=hint |
| 116 | +resharper_simplify_linq_expression_use_all_highlighting=none |
| 117 | + |
| 118 | +[*.{cs,vb}] |
| 119 | +max_line_length=200 |
| 120 | +csharp_max_line_length=200 |
| 121 | + |
| 122 | +# IDE0005: Using directive is unnecessary. |
| 123 | +dotnet_diagnostic.IDE0005.severity = warning |
| 124 | + |
| 125 | +# IDE0055: Fix formatting |
| 126 | +dotnet_diagnostic.IDE0055.severity = warning |
| 127 | + |
| 128 | +# IDE0290: Use primary constructors |
| 129 | +dotnet_diagnostic.IDE0290.severity = none |
| 130 | + |
| 131 | +dotnet_naming_rule.private_members_with_underscore.symbols = private_fields |
| 132 | +dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore |
| 133 | +dotnet_naming_rule.private_members_with_underscore.severity = suggestion |
| 134 | + |
| 135 | +dotnet_naming_symbols.private_fields.applicable_kinds = field |
| 136 | +dotnet_naming_symbols.private_fields.applicable_accessibilities = private |
| 137 | + |
| 138 | +dotnet_naming_style.prefix_underscore.capitalization = camel_case |
| 139 | +dotnet_naming_style.prefix_underscore.required_prefix = _ |
| 140 | + |
| 141 | +# Roslynator |
| 142 | + |
| 143 | +dotnet_diagnostic.RCS0003.severity = warning |
| 144 | +dotnet_diagnostic.RCS0008.severity = warning |
| 145 | +dotnet_diagnostic.RCS0010.severity = warning |
| 146 | +dotnet_diagnostic.RCS0063.severity = warning |
| 147 | +dotnet_diagnostic.RCS1001.severity = warning |
| 148 | +dotnet_diagnostic.RCS1002.severity = none |
| 149 | +dotnet_diagnostic.RCS1003.severity = warning |
| 150 | +dotnet_diagnostic.RCS1007.severity = warning |
| 151 | +dotnet_diagnostic.RCS1013.severity = warning |
| 152 | +dotnet_diagnostic.RCS1077.severity = none |
| 153 | +dotnet_diagnostic.RCS1037.severity = warning |
| 154 | +dotnet_diagnostic.RCS1057.severity = warning |
| 155 | +dotnet_diagnostic.RCS1080.severity = none |
| 156 | +dotnet_diagnostic.RCS1090.severity = none |
| 157 | +dotnet_diagnostic.RCS1096.severity = none |
| 158 | +dotnet_diagnostic.RCS1010.severity = warning |
| 159 | +dotnet_diagnostic.RCS1118.severity = none |
| 160 | +dotnet_diagnostic.RCS1124.severity = none |
| 161 | +dotnet_diagnostic.RCS1173.severity = none |
| 162 | +dotnet_diagnostic.RCS1177.severity = warning |
| 163 | +dotnet_diagnostic.RCS1179.severity = none |
| 164 | +dotnet_diagnostic.RCS1221.severity = none |
| 165 | +dotnet_diagnostic.RCS1224.severity = none |
| 166 | +dotnet_diagnostic.RCS1260.severity = warning |
| 167 | +dotnet_diagnostic.RCS1264.severity = warning |
| 168 | +dotnet_diagnostic.RCS0003.severity = warning |
| 169 | +dotnet_diagnostic.RCS1046.severity = warning |
| 170 | +dotnet_diagnostic.RCS1094.severity = warning |
| 171 | +dotnet_diagnostic.RCS1128.severity = none # Use coalesce expression. |
| 172 | +dotnet_diagnostic.RCS1197.severity = none |
| 173 | + |
| 174 | +# Globalization diagnostics |
| 175 | + |
| 176 | +dotnet_diagnostic.CA1304.severity = warning |
| 177 | +dotnet_diagnostic.CA1305.severity = none |
| 178 | +dotnet_diagnostic.CA1307.severity = warning |
| 179 | +dotnet_diagnostic.CA1308.severity = none |
| 180 | +dotnet_diagnostic.CA1309.severity = warning |
| 181 | +dotnet_diagnostic.CA1310.severity = warning |
| 182 | + |
| 183 | +# Other diagnostics |
| 184 | + |
| 185 | +dotnet_diagnostic.IDE0019.severity = none |
| 186 | +dotnet_diagnostic.IDE0019WithoutSuggestion.severity = none |
| 187 | +dotnet_diagnostic.IDE0037.severity = none |
| 188 | +dotnet_diagnostic.IDE0037WithoutSuggestion.severity = none |
| 189 | +dotnet_diagnostic.IDE0049.severity = none |
| 190 | +dotnet_diagnostic.IDE0130.severity = warning |
| 191 | +dotnet_diagnostic.IDE0160.severity = none |
| 192 | +dotnet_diagnostic.IDE0161.severity = warning |
| 193 | +dotnet_diagnostic.IDE0270.severity = none # Null check can be simplified |
| 194 | +dotnet_diagnostic.IDE1006.severity = warning |
| 195 | +dotnet_diagnostic.CA1041.severity = warning |
| 196 | +dotnet_diagnostic.CA1507.severity = warning |
| 197 | +dotnet_diagnostic.CA1710.severity = warning |
| 198 | +dotnet_diagnostic.CA1820.severity = warning |
| 199 | +dotnet_diagnostic.CA1825.severity = warning |
| 200 | +dotnet_diagnostic.CA1827.severity = warning |
| 201 | +dotnet_diagnostic.CA1828.severity = warning |
| 202 | +dotnet_diagnostic.CA1829.severity = warning |
| 203 | +dotnet_diagnostic.CA1841.severity = warning |
| 204 | +dotnet_diagnostic.CA1849.severity = warning |
| 205 | +dotnet_diagnostic.CA1851.severity = warning |
| 206 | +dotnet_diagnostic.CA1854.severity = warning |
| 207 | +dotnet_diagnostic.CA2016.severity = warning |
| 208 | +dotnet_diagnostic.CA2017.severity = warning |
| 209 | +dotnet_diagnostic.CA2254.severity = warning |
| 210 | +dotnet_diagnostic.RS0030.severity = error |
| 211 | + |
| 212 | +# These are disabled due to https://github.com/dotnet/roslyn/issues/41640 |
| 213 | +dotnet_diagnostic.CS1573.severity = none # Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do) |
| 214 | +dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member 'Type_or_Member' |
| 215 | + |
| 216 | +# Karls Analyzers |
| 217 | + |
| 218 | +dotnet_diagnostic.KP0001.severity = warning |
| 219 | + |
| 220 | +# Disable some warnings for tests |
| 221 | + |
| 222 | +[test/**] |
| 223 | +dotnet_diagnostic.CA1851.severity = none |
| 224 | + |
| 225 | +[*.{appxmanifest,axml,build,dbml,discomap,dtd,jsproj,lsproj,njsproj,nuspec,proj,proto,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}] |
| 226 | +indent_style=tab |
| 227 | +indent_size=tab |
| 228 | +tab_width=4 |
| 229 | + |
| 230 | +[*.{asax,ascx,aspx,cs,cshtml,css,htm,html,razor,config}] |
| 231 | +indent_style=space |
| 232 | +indent_size=4 |
| 233 | +tab_width=4 |
| 234 | + |
| 235 | +[*.{js,mjs,json,resjson,csproj,props,scss,css,yml,yaml}] |
| 236 | +indent_style=space |
| 237 | +indent_size=2 |
| 238 | +tab_width=2 |
| 239 | + |
| 240 | +[*.sh] |
| 241 | +end_of_line=lf |
0 commit comments