|
1 | | -# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\Users\thieu\GitHub\ExtensionPackTools codebase based on best match to current usage at 2019-02-22 |
2 | | -# You can modify the rules from these initially generated values to suit your own policies |
3 | | -# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference |
4 | | -[*.cs] |
| 1 | +root = true |
5 | 2 |
|
6 | | -#Core editorconfig formatting - indentation |
| 3 | +############################### |
| 4 | +# Core EditorConfig Options # |
| 5 | +############################### |
7 | 6 |
|
8 | | -#use soft tabs (spaces) for indentation |
| 7 | +[*] |
| 8 | +charset = utf-8 |
| 9 | +indent_size = 4 |
9 | 10 | indent_style = space |
| 11 | +end_of_line = lf |
| 12 | +insert_final_newline = true |
| 13 | +tab_width = 4 |
| 14 | + |
| 15 | +[*.json] |
| 16 | +indent_size = 2 |
| 17 | + |
| 18 | +[*.{csproj,props,targets}] |
| 19 | +indent_size = 2 |
10 | 20 |
|
11 | | -#Formatting - new line options |
| 21 | +[*.{cs,csx,vb,vbx}] |
| 22 | +indent_size = 4 |
12 | 23 |
|
13 | | -#require braces to be on a new line for control_blocks, methods, object_collection, types, lambdas, and properties (also known as "Allman" style) |
14 | | -csharp_new_line_before_open_brace = control_blocks, methods, object_collection, types, lambdas, properties |
| 24 | +############################### |
| 25 | +# C# Coding Conventions # |
| 26 | +############################### |
15 | 27 |
|
16 | | -#Formatting - organize using options |
| 28 | +[*.cs] |
17 | 29 |
|
18 | | -#sort System.* using directives alphabetically, and place them before other usings |
| 30 | +# Organize usings |
| 31 | +dotnet_separate_import_directive_groups = true |
19 | 32 | dotnet_sort_system_directives_first = true |
| 33 | +file_header_template = unset |
| 34 | + |
| 35 | +# this. preferences |
| 36 | +dotnet_style_qualification_for_field = false:suggestion |
| 37 | +dotnet_style_qualification_for_property = false:suggestion |
| 38 | +dotnet_style_qualification_for_method = false:suggestion |
| 39 | +dotnet_style_qualification_for_event = false:suggestion |
| 40 | + |
| 41 | +# Language keywords vs BCL types preferences |
| 42 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 43 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 44 | + |
| 45 | +# Parentheses preferences |
| 46 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion |
| 47 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion |
| 48 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary |
| 49 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion |
| 50 | + |
| 51 | +# Modifier preferences |
| 52 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members |
| 53 | +dotnet_style_readonly_field = true:warning |
| 54 | + |
| 55 | +# Expression-level preferences |
| 56 | +dotnet_style_coalesce_expression = true:silent |
| 57 | +dotnet_style_collection_initializer = true:silent |
| 58 | +dotnet_style_explicit_tuple_names = true:warning |
| 59 | +dotnet_style_namespace_match_folder = true |
| 60 | +dotnet_style_null_propagation = true |
| 61 | +dotnet_style_object_initializer = true:silent |
| 62 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 63 | +dotnet_style_prefer_auto_properties = true |
| 64 | +dotnet_style_prefer_compound_assignment = true |
| 65 | +dotnet_style_prefer_conditional_expression_over_assignment = true |
| 66 | +dotnet_style_prefer_conditional_expression_over_return = true |
| 67 | +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed |
| 68 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:silent |
| 69 | +dotnet_style_prefer_inferred_tuple_names = true:silent |
| 70 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true |
| 71 | +dotnet_style_prefer_simplified_boolean_expressions = true |
| 72 | +dotnet_style_prefer_simplified_interpolation = true |
| 73 | + |
| 74 | +# New line preferences |
| 75 | +dotnet_style_allow_multiple_blank_lines_experimental = false |
| 76 | +dotnet_style_allow_statement_immediately_after_block_experimental = false:suggestion |
| 77 | + |
| 78 | +# var preferences |
| 79 | +csharp_style_var_elsewhere = true:suggestion |
| 80 | +csharp_style_var_for_built_in_types = true:suggestion |
| 81 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 82 | + |
| 83 | +# Expression-bodied members |
| 84 | +csharp_style_expression_bodied_accessors = true:suggestion |
| 85 | +csharp_style_expression_bodied_constructors = false |
| 86 | +csharp_style_expression_bodied_indexers = true |
| 87 | +csharp_style_expression_bodied_lambdas = when_on_single_line |
| 88 | +csharp_style_expression_bodied_local_functions = false |
| 89 | +csharp_style_expression_bodied_methods = false |
| 90 | +csharp_style_expression_bodied_operators = false |
| 91 | +csharp_style_expression_bodied_properties = true |
| 92 | + |
| 93 | +# Pattern matching preferences |
| 94 | +csharp_style_pattern_matching_over_as_with_null_check = true |
| 95 | +csharp_style_pattern_matching_over_is_with_cast_check = true |
| 96 | +csharp_style_prefer_extended_property_pattern = true |
| 97 | +csharp_style_prefer_not_pattern = true |
| 98 | +csharp_style_prefer_pattern_matching = true:suggestion |
| 99 | +csharp_style_prefer_switch_expression = false:silent |
| 100 | + |
| 101 | +# Null-checking preferences |
| 102 | +csharp_style_throw_expression = true:suggestion |
| 103 | +csharp_style_conditional_delegate_call = true |
| 104 | + |
| 105 | +# Modifier preferences |
| 106 | +csharp_prefer_static_local_function = true |
| 107 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async |
| 108 | +csharp_style_prefer_readonly_struct = true:warning |
| 109 | +csharp_style_prefer_readonly_struct_member = true |
| 110 | + |
| 111 | +# Code-block preferences |
| 112 | +csharp_prefer_braces = true |
| 113 | +csharp_prefer_simple_using_statement = false |
| 114 | +csharp_style_namespace_declarations = file_scoped:suggestion |
| 115 | +csharp_style_prefer_method_group_conversion = true:suggestion |
| 116 | +csharp_style_prefer_top_level_statements = true |
| 117 | + |
| 118 | +# Expression-level preferences |
| 119 | +csharp_prefer_simple_default_expression = true |
| 120 | +csharp_style_deconstructed_variable_declaration = false |
| 121 | +csharp_style_implicit_object_creation_when_type_is_apparent = false |
| 122 | +csharp_style_inlined_variable_declaration = true |
| 123 | +csharp_style_prefer_index_operator = true |
| 124 | +csharp_style_prefer_local_over_anonymous_function = true |
| 125 | +csharp_style_prefer_null_check_over_type_check = true |
| 126 | +csharp_style_prefer_range_operator = true |
| 127 | +csharp_style_prefer_tuple_swap = true |
| 128 | +csharp_style_prefer_utf8_string_literals = true |
| 129 | +csharp_style_throw_expression = true |
| 130 | +csharp_style_unused_value_assignment_preference = discard_variable |
| 131 | +csharp_style_unused_value_expression_statement_preference = discard_variable:silent |
| 132 | +csharp_style_pattern_local_over_anonymous_function = true:suggestion |
20 | 133 |
|
21 | | -#Formatting - spacing options |
| 134 | +# Parameter preferences |
| 135 | +dotnet_code_quality_unused_parameters = non_public:warning |
22 | 136 |
|
23 | | -#require NO space between a cast and the value |
| 137 | +# 'using' directive preferences |
| 138 | +csharp_using_directive_placement = outside_namespace:warning |
| 139 | + |
| 140 | +############################### |
| 141 | +# Formatting Rules # |
| 142 | +############################### |
| 143 | + |
| 144 | +# New line preferences |
| 145 | +csharp_new_line_before_open_brace = all |
| 146 | +csharp_new_line_before_else = true |
| 147 | +csharp_new_line_before_catch = true |
| 148 | +csharp_new_line_before_finally = true |
| 149 | +csharp_new_line_before_members_in_object_initializers = true |
| 150 | +csharp_new_line_before_members_in_anonymous_types = true |
| 151 | +csharp_new_line_between_query_expression_clauses = true |
| 152 | +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false |
| 153 | +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false |
| 154 | +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false |
| 155 | +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false |
| 156 | +csharp_style_allow_embedded_statements_on_same_line_experimental = false |
| 157 | + |
| 158 | +# Indentation preferences |
| 159 | +csharp_indent_block_contents = true |
| 160 | +csharp_indent_braces = false |
| 161 | +csharp_indent_case_contents = true |
| 162 | +csharp_indent_case_contents_when_block = false |
| 163 | +csharp_indent_labels = no_change |
| 164 | +csharp_indent_switch_labels = true |
| 165 | + |
| 166 | +# Space preferences |
24 | 167 | csharp_space_after_cast = false |
25 | | -#require a space before the colon for bases or interfaces in a type declaration |
26 | 168 | csharp_space_after_colon_in_inheritance_clause = true |
27 | | -#require a space after a keyword in a control flow statement such as a for loop |
| 169 | +csharp_space_after_comma = true |
| 170 | +csharp_space_after_dot = false |
28 | 171 | csharp_space_after_keywords_in_control_flow_statements = true |
29 | | -#require a space before the colon for bases or interfaces in a type declaration |
| 172 | +csharp_space_after_semicolon_in_for_statement = true |
| 173 | +csharp_space_around_binary_operators = before_and_after |
| 174 | +csharp_space_around_declaration_statements = false |
30 | 175 | csharp_space_before_colon_in_inheritance_clause = true |
31 | | -#remove space within empty argument list parentheses |
| 176 | +csharp_space_before_comma = false |
| 177 | +csharp_space_before_dot = false |
| 178 | +csharp_space_before_open_square_brackets = false |
| 179 | +csharp_space_before_semicolon_in_for_statement = false |
| 180 | +csharp_space_between_empty_square_brackets = false |
32 | 181 | csharp_space_between_method_call_empty_parameter_list_parentheses = false |
33 | | -#remove space between method call name and opening parenthesis |
34 | 182 | csharp_space_between_method_call_name_and_opening_parenthesis = false |
35 | | -#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call |
36 | 183 | csharp_space_between_method_call_parameter_list_parentheses = false |
37 | | -#remove space within empty parameter list parentheses for a method declaration |
38 | 184 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
39 | | -#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. |
| 185 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
40 | 186 | csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 187 | +csharp_space_between_parentheses = false |
| 188 | +csharp_space_between_square_brackets = false |
41 | 189 |
|
42 | | -#Formatting - wrapping options |
43 | | - |
44 | | -#leave code block on single line |
| 190 | +# Wrapping preferences |
45 | 191 | csharp_preserve_single_line_blocks = true |
| 192 | +csharp_preserve_single_line_statements = false |
46 | 193 |
|
47 | | -#Style - expression bodied member options |
| 194 | +# Namespaces |
| 195 | +csharp_style_namespace_declarations=file_scoped:suggestion |
48 | 196 |
|
49 | | -#prefer block bodies for accessors |
50 | | -csharp_style_expression_bodied_accessors = false:suggestion |
51 | | -#prefer block bodies for constructors |
52 | | -csharp_style_expression_bodied_constructors = false:suggestion |
53 | | -#prefer block bodies for methods |
54 | | -csharp_style_expression_bodied_methods = false:suggestion |
55 | | -#prefer expression-bodied members for properties |
56 | | -csharp_style_expression_bodied_properties = true:suggestion |
| 197 | +############################### |
| 198 | +# Naming Conventions # |
| 199 | +############################### |
57 | 200 |
|
58 | | -#Style - expression level options |
| 201 | +# Naming rules |
59 | 202 |
|
60 | | -#prefer out variables to be declared inline in the argument list of a method call when possible |
61 | | -csharp_style_inlined_variable_declaration = true:suggestion |
62 | | -#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them |
63 | | -dotnet_style_predefined_type_for_member_access = true:suggestion |
| 203 | +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion |
| 204 | +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
| 205 | +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
64 | 206 |
|
65 | | -#Style - implicit and explicit types |
| 207 | +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion |
| 208 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 209 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
66 | 210 |
|
67 | | -#prefer var is used to declare variables with built-in system types such as int |
68 | | -csharp_style_var_for_built_in_types = true:suggestion |
69 | | -#prefer var when the type is already mentioned on the right-hand side of a declaration expression |
70 | | -csharp_style_var_when_type_is_apparent = true:suggestion |
| 211 | +dotnet_naming_rule.const_field_should_be_pascal_case.severity = suggestion |
| 212 | +dotnet_naming_rule.const_field_should_be_pascal_case.symbols = const_field |
| 213 | +dotnet_naming_rule.const_field_should_be_pascal_case.style = pascal_case |
71 | 214 |
|
72 | | -#Style - language keyword and framework type options |
| 215 | +dotnet_naming_rule.private_field_should_be_underscore_camel_case.severity = suggestion |
| 216 | +dotnet_naming_rule.private_field_should_be_underscore_camel_case.symbols = private_field |
| 217 | +dotnet_naming_rule.private_field_should_be_underscore_camel_case.style = underscore_camel_case |
73 | 218 |
|
74 | | -#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them |
75 | | -dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 219 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion |
| 220 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 221 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
76 | 222 |
|
77 | | -#Style - qualification options |
| 223 | +# Symbol specifications |
78 | 224 |
|
79 | | -#prefer fields not to be prefaced with this. or Me. in Visual Basic |
80 | | -dotnet_style_qualification_for_field = false:suggestion |
81 | | -#prefer methods not to be prefaced with this. or Me. in Visual Basic |
82 | | -dotnet_style_qualification_for_method = false:suggestion |
83 | | -#prefer properties not to be prefaced with this. or Me. in Visual Basic |
84 | | -dotnet_style_qualification_for_property = false:suggestion |
| 225 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 226 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 227 | +dotnet_naming_symbols.interface.required_modifiers = |
| 228 | + |
| 229 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 230 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 231 | +dotnet_naming_symbols.types.required_modifiers = |
| 232 | + |
| 233 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 234 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 235 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 236 | + |
| 237 | +dotnet_naming_symbols.private_field.applicable_kinds = field |
| 238 | +dotnet_naming_symbols.private_field.applicable_accessibilities = private |
| 239 | +dotnet_naming_symbols.private_field.required_modifiers = |
| 240 | + |
| 241 | +dotnet_naming_symbols.const_field.applicable_kinds = field |
| 242 | +dotnet_naming_symbols.const_field.applicable_accessibilities = * |
| 243 | +dotnet_naming_symbols.const_field.required_modifiers = const |
| 244 | + |
| 245 | +# Naming styles |
| 246 | + |
| 247 | +dotnet_naming_style.pascal_case.required_prefix = |
| 248 | +dotnet_naming_style.pascal_case.required_suffix = |
| 249 | +dotnet_naming_style.pascal_case.word_separator = |
| 250 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 251 | + |
| 252 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 253 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 254 | +dotnet_naming_style.begins_with_i.word_separator = |
| 255 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
| 256 | + |
| 257 | +dotnet_naming_style.underscore_camel_case.required_prefix = _ |
| 258 | +dotnet_naming_style.underscore_camel_case.required_suffix = |
| 259 | +dotnet_naming_style.underscore_camel_case.word_separator = |
| 260 | +dotnet_naming_style.underscore_camel_case.capitalization = camel_case |
| 261 | + |
| 262 | +############################### |
| 263 | +# Suppression preferences # |
| 264 | +############################### |
| 265 | + |
| 266 | +dotnet_remove_unnecessary_suppression_exclusions = none |
| 267 | + |
| 268 | +# CA2016: Forward the 'CancellationToken' parameter to methods |
| 269 | +dotnet_diagnostic.CA2016.severity = warning |
| 270 | + |
| 271 | +# IDE0047: Remove unnecessary parentheses |
| 272 | +dotnet_diagnostic.IDE0047.severity = none |
0 commit comments