|
1 | | -# Version: 1.6.2 (Using https://semver.org/) |
2 | | -# Updated: 2020-11-02 |
| 1 | +# Version: 2.0.0 (Using https://semver.org/) |
| 2 | +# Updated: 2020-11-15 |
3 | 3 | # See https://github.com/RehanSaeed/EditorConfig/releases for release notes. |
4 | 4 | # See https://github.com/RehanSaeed/EditorConfig for updates to this file. |
5 | 5 | # See http://EditorConfig.org for more information about .editorconfig files. |
@@ -80,106 +80,115 @@ indent_style = tab |
80 | 80 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions |
81 | 81 | ########################################## |
82 | 82 |
|
| 83 | +# Default Severity for .NET Code Style |
| 84 | +# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope |
| 85 | +dotnet_analyzer_diagnostic.severity = warning |
| 86 | + |
83 | 87 | # .NET Code Style Settings |
84 | 88 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings |
85 | 89 | [*.{cs,csx,cake,vb,vbx}] |
86 | 90 | # "this." and "Me." qualifiers |
87 | 91 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me |
88 | | -dotnet_style_qualification_for_field = true:warning |
89 | | -dotnet_style_qualification_for_property = true:warning |
90 | | -dotnet_style_qualification_for_method = true:warning |
91 | | -dotnet_style_qualification_for_event = true:warning |
| 92 | +dotnet_style_qualification_for_field = true |
| 93 | +dotnet_style_qualification_for_property = true |
| 94 | +dotnet_style_qualification_for_method = true |
| 95 | +dotnet_style_qualification_for_event = true |
92 | 96 | # Language keywords instead of framework type names for type references |
93 | 97 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords |
94 | | -dotnet_style_predefined_type_for_locals_parameters_members = true:warning |
95 | | -dotnet_style_predefined_type_for_member_access = true:warning |
| 98 | +dotnet_style_predefined_type_for_locals_parameters_members = true |
| 99 | +dotnet_style_predefined_type_for_member_access = true |
96 | 100 | # Modifier preferences |
97 | 101 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers |
98 | | -dotnet_style_require_accessibility_modifiers = always:warning |
99 | | -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning |
100 | | -visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning |
101 | | -dotnet_style_readonly_field = true:warning |
| 102 | +dotnet_style_require_accessibility_modifiers = always |
| 103 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async |
| 104 | +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async |
| 105 | +dotnet_style_readonly_field = true |
102 | 106 | # Parentheses preferences |
103 | 107 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences |
104 | | -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning |
105 | | -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning |
106 | | -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning |
107 | | -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion |
| 108 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity |
| 109 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity |
| 110 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity |
| 111 | +dotnet_style_parentheses_in_other_operators = always_for_clarity |
108 | 112 | # Expression-level preferences |
109 | 113 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences |
110 | | -dotnet_style_object_initializer = true:warning |
111 | | -dotnet_style_collection_initializer = true:warning |
112 | | -dotnet_style_explicit_tuple_names = true:warning |
113 | | -dotnet_style_prefer_inferred_tuple_names = true:warning |
114 | | -dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning |
115 | | -dotnet_style_prefer_auto_properties = true:warning |
116 | | -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning |
117 | | -dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion |
118 | | -dotnet_style_prefer_conditional_expression_over_return = false:suggestion |
119 | | -dotnet_style_prefer_compound_assignment = true:warning |
| 114 | +dotnet_style_object_initializer = true |
| 115 | +dotnet_style_collection_initializer = true |
| 116 | +dotnet_style_explicit_tuple_names = true |
| 117 | +dotnet_style_prefer_inferred_tuple_names = true |
| 118 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true |
| 119 | +dotnet_style_prefer_auto_properties = true |
| 120 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true |
| 121 | +dotnet_style_prefer_conditional_expression_over_assignment = false |
| 122 | +dotnet_diagnostic.IDE0045.severity = suggestion |
| 123 | +dotnet_style_prefer_conditional_expression_over_return = false |
| 124 | +dotnet_diagnostic.IDE0046.severity = suggestion |
| 125 | +dotnet_style_prefer_compound_assignment = true |
120 | 126 | # Null-checking preferences |
121 | 127 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences |
122 | | -dotnet_style_coalesce_expression = true:warning |
123 | | -dotnet_style_null_propagation = true:warning |
| 128 | +dotnet_style_coalesce_expression = true |
| 129 | +dotnet_style_null_propagation = true |
124 | 130 | # Parameter preferences |
125 | 131 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences |
126 | | -dotnet_code_quality_unused_parameters = all:warning |
| 132 | +dotnet_code_quality_unused_parameters = all |
127 | 133 | # More style options (Undocumented) |
128 | 134 | # https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641 |
129 | 135 | dotnet_style_operator_placement_when_wrapping = end_of_line |
130 | 136 | # https://github.com/dotnet/roslyn/pull/40070 |
131 | | -dotnet_style_prefer_simplified_interpolation = true:warning |
| 137 | +dotnet_style_prefer_simplified_interpolation = true |
132 | 138 |
|
133 | 139 | # C# Code Style Settings |
134 | 140 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings |
135 | 141 | [*.{cs,csx,cake}] |
136 | 142 | # Implicit and explicit types |
137 | 143 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types |
138 | | -csharp_style_var_for_built_in_types = true:warning |
139 | | -csharp_style_var_when_type_is_apparent = true:warning |
140 | | -csharp_style_var_elsewhere = true:warning |
| 144 | +csharp_style_var_for_built_in_types = true |
| 145 | +csharp_style_var_when_type_is_apparent = true |
| 146 | +csharp_style_var_elsewhere = true |
141 | 147 | # Expression-bodied members |
142 | 148 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members |
143 | | -csharp_style_expression_bodied_methods = true:warning |
144 | | -csharp_style_expression_bodied_constructors = true:warning |
145 | | -csharp_style_expression_bodied_operators = true:warning |
146 | | -csharp_style_expression_bodied_properties = true:warning |
147 | | -csharp_style_expression_bodied_indexers = true:warning |
148 | | -csharp_style_expression_bodied_accessors = true:warning |
149 | | -csharp_style_expression_bodied_lambdas = true:warning |
150 | | -csharp_style_expression_bodied_local_functions = true:warning |
| 149 | +csharp_style_expression_bodied_methods = true |
| 150 | +csharp_style_expression_bodied_constructors = true |
| 151 | +csharp_style_expression_bodied_operators = true |
| 152 | +csharp_style_expression_bodied_properties = true |
| 153 | +csharp_style_expression_bodied_indexers = true |
| 154 | +csharp_style_expression_bodied_accessors = true |
| 155 | +csharp_style_expression_bodied_lambdas = true |
| 156 | +csharp_style_expression_bodied_local_functions = true |
151 | 157 | # Pattern matching |
152 | 158 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching |
153 | | -csharp_style_pattern_matching_over_is_with_cast_check = true:warning |
154 | | -csharp_style_pattern_matching_over_as_with_null_check = true:warning |
| 159 | +csharp_style_pattern_matching_over_is_with_cast_check = true |
| 160 | +csharp_style_pattern_matching_over_as_with_null_check = true |
155 | 161 | # Inlined variable declarations |
156 | 162 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations |
157 | | -csharp_style_inlined_variable_declaration = true:warning |
| 163 | +csharp_style_inlined_variable_declaration = true |
158 | 164 | # Expression-level preferences |
159 | 165 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences |
160 | | -csharp_prefer_simple_default_expression = true:warning |
| 166 | +csharp_prefer_simple_default_expression = true |
161 | 167 | # "Null" checking preferences |
162 | 168 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences |
163 | | -csharp_style_throw_expression = true:warning |
164 | | -csharp_style_conditional_delegate_call = true:warning |
| 169 | +csharp_style_throw_expression = true |
| 170 | +csharp_style_conditional_delegate_call = true |
165 | 171 | # Code block preferences |
166 | 172 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences |
167 | | -csharp_prefer_braces = true:warning |
| 173 | +csharp_prefer_braces = true |
168 | 174 | # Unused value preferences |
169 | 175 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences |
170 | | -csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion |
171 | | -csharp_style_unused_value_assignment_preference = discard_variable:suggestion |
| 176 | +csharp_style_unused_value_expression_statement_preference = discard_variable |
| 177 | +dotnet_diagnostic.IDE0058.severity = suggestion |
| 178 | +csharp_style_unused_value_assignment_preference = discard_variable |
| 179 | +dotnet_diagnostic.IDE0059.severity = suggestion |
172 | 180 | # Index and range preferences |
173 | 181 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences |
174 | | -csharp_style_prefer_index_operator = true:warning |
175 | | -csharp_style_prefer_range_operator = true:warning |
| 182 | +csharp_style_prefer_index_operator = true |
| 183 | +csharp_style_prefer_range_operator = true |
176 | 184 | # Miscellaneous preferences |
177 | 185 | # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences |
178 | | -csharp_style_deconstructed_variable_declaration = true:warning |
179 | | -csharp_style_pattern_local_over_anonymous_function = true:warning |
180 | | -csharp_using_directive_placement = inside_namespace:warning |
181 | | -csharp_prefer_static_local_function = true:warning |
182 | | -csharp_prefer_simple_using_statement = true:suggestion |
| 186 | +csharp_style_deconstructed_variable_declaration = true |
| 187 | +csharp_style_pattern_local_over_anonymous_function = true |
| 188 | +csharp_using_directive_placement = inside_namespace |
| 189 | +csharp_prefer_static_local_function = true |
| 190 | +csharp_prefer_simple_using_statement = true |
| 191 | +dotnet_diagnostic.IDE0063.severity = suggestion |
183 | 192 |
|
184 | 193 | ########################################## |
185 | 194 | # .NET Formatting Conventions |
|
0 commit comments