1
- # Version: 1.6.2 (Using https://semver.org/)
2
- # Updated: 2020-11-02
1
+ # Version: 2.1.0 (Using https://semver.org/)
2
+ # Updated: 2021-03-03
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.
@@ -60,87 +60,84 @@ indent_size = 2
60
60
[* .{cmd,bat} ]
61
61
end_of_line = crlf
62
62
63
+ # Bash Files
64
+ [* .sh ]
65
+ end_of_line = lf
66
+
63
67
# Makefiles
64
68
[Makefile ]
65
69
indent_style = tab
66
70
67
71
# #########################################
68
- # File Header (Uncomment to support file headers)
69
- # https://docs.microsoft.com/visualstudio/ide/reference/add-file-header
72
+ # Default .NET Code Style Severities
73
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
70
74
# #########################################
71
75
72
- # [*.{cs,csx,cake,vb,vbx,tt,ttinclude}]
73
- file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2 .0.
74
-
75
- # SA1636: File header copyright text should match
76
- # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
77
- # dotnet_diagnostic.SA1636.severity = none
76
+ [* .{cs,csx,cake,vb,vbx} ]
77
+ # Default Severity for all .NET Code Style rules below
78
+ dotnet_analyzer_diagnostic.severity = warning
78
79
79
80
# #########################################
80
- # .NET Language Conventions
81
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions
81
+ # Language Rules
82
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules
82
83
# #########################################
83
84
84
- # .NET Code Style Settings
85
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions #net-code- style-settings
85
+ # .NET Style Rules
86
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules #net-style-rules
86
87
[* .{cs,csx,cake,vb,vbx} ]
87
88
# "this." and "Me." qualifiers
88
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
89
89
dotnet_style_qualification_for_field = true :warning
90
90
dotnet_style_qualification_for_property = true :warning
91
91
dotnet_style_qualification_for_method = true :warning
92
92
dotnet_style_qualification_for_event = true :warning
93
93
# Language keywords instead of framework type names for type references
94
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
95
94
dotnet_style_predefined_type_for_locals_parameters_members = true :warning
96
95
dotnet_style_predefined_type_for_member_access = true :warning
97
96
# Modifier preferences
98
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
99
97
dotnet_style_require_accessibility_modifiers = always:warning
100
98
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
101
99
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
102
100
dotnet_style_readonly_field = true :warning
103
101
# Parentheses preferences
104
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
105
102
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
106
103
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
107
104
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
108
- dotnet_style_parentheses_in_other_operators = never_if_unnecessary :suggestion
105
+ dotnet_style_parentheses_in_other_operators = always_for_clarity :suggestion
109
106
# Expression-level preferences
110
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
111
107
dotnet_style_object_initializer = true :warning
112
108
dotnet_style_collection_initializer = true :warning
113
109
dotnet_style_explicit_tuple_names = true :warning
114
110
dotnet_style_prefer_inferred_tuple_names = true :warning
115
111
dotnet_style_prefer_inferred_anonymous_type_member_names = true :warning
116
112
dotnet_style_prefer_auto_properties = true :warning
117
- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
118
113
dotnet_style_prefer_conditional_expression_over_assignment = false :suggestion
114
+ dotnet_diagnostic.IDE0045.severity = suggestion
119
115
dotnet_style_prefer_conditional_expression_over_return = false :suggestion
116
+ dotnet_diagnostic.IDE0046.severity = suggestion
120
117
dotnet_style_prefer_compound_assignment = true :warning
118
+ dotnet_style_prefer_simplified_interpolation = true :warning
119
+ dotnet_style_prefer_simplified_boolean_expressions = true :warning
121
120
# Null-checking preferences
122
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
123
121
dotnet_style_coalesce_expression = true :warning
124
122
dotnet_style_null_propagation = true :warning
125
- # Parameter preferences
126
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences
127
- dotnet_code_quality_unused_parameters = all:warning
128
- # More style options (Undocumented)
129
- # https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
123
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
124
+ # File header preferences
125
+ file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2 .0.
126
+ # SA1636: File header copyright text should match
127
+ # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
128
+ # dotnet_diagnostic.SA1636.severity = none
129
+
130
+ # Undocumented
130
131
dotnet_style_operator_placement_when_wrapping = end_of_line
131
- # https://github.com/dotnet/roslyn/pull/40070
132
- dotnet_style_prefer_simplified_interpolation = true :warning
133
132
134
- # C# Code Style Settings
135
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions #c-code- style-settings
133
+ # C# Style Rules
134
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules #c-style-rules
136
135
[* .{cs,csx,cake} ]
137
- # Implicit and explicit types
138
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
136
+ # 'var' preferences
139
137
csharp_style_var_for_built_in_types = never
140
138
csharp_style_var_when_type_is_apparent = true :warning
141
139
csharp_style_var_elsewhere = false :warning
142
140
# Expression-bodied members
143
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
144
141
csharp_style_expression_bodied_methods = true :warning
145
142
csharp_style_expression_bodied_constructors = true :warning
146
143
csharp_style_expression_bodied_operators = true :warning
@@ -149,47 +146,64 @@ csharp_style_expression_bodied_indexers = true:warning
149
146
csharp_style_expression_bodied_accessors = true :warning
150
147
csharp_style_expression_bodied_lambdas = true :warning
151
148
csharp_style_expression_bodied_local_functions = true :warning
152
- # Pattern matching
153
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
149
+ # Pattern matching preferences
154
150
csharp_style_pattern_matching_over_is_with_cast_check = true :warning
155
151
csharp_style_pattern_matching_over_as_with_null_check = true :warning
156
- # Inlined variable declarations
157
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations
158
- csharp_style_inlined_variable_declaration = true :warning
152
+ csharp_style_prefer_switch_expression = true : warning
153
+ csharp_style_prefer_pattern_matching = true : warning
154
+ csharp_style_prefer_not_pattern = true :warning
159
155
# Expression-level preferences
160
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
156
+ csharp_style_inlined_variable_declaration = true : warning
161
157
csharp_prefer_simple_default_expression = true :warning
158
+ csharp_style_pattern_local_over_anonymous_function = true :warning
159
+ csharp_style_deconstructed_variable_declaration = true :warning
160
+ csharp_style_prefer_index_operator = true :warning
161
+ csharp_style_prefer_range_operator = true :warning
162
+ csharp_style_implicit_object_creation_when_type_is_apparent = true :warning
162
163
# "Null" checking preferences
163
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
164
164
csharp_style_throw_expression = true :warning
165
165
csharp_style_conditional_delegate_call = true :warning
166
166
# Code block preferences
167
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
168
167
csharp_prefer_braces = true :warning
169
- # Unused value preferences
170
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences
171
- csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
172
- csharp_style_unused_value_assignment_preference = discard_variable:suggestion
173
- # Index and range preferences
174
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
175
- csharp_style_prefer_index_operator = true :warning
176
- csharp_style_prefer_range_operator = true :warning
177
- # Miscellaneous preferences
178
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
179
- csharp_style_deconstructed_variable_declaration = true :warning
180
- csharp_style_pattern_local_over_anonymous_function = true :warning
168
+ csharp_prefer_simple_using_statement = true :suggestion
169
+ dotnet_diagnostic.IDE0063.severity = suggestion
170
+ # 'using' directive preferences
181
171
csharp_using_directive_placement = outside_namespace:warning
172
+ # Modifier preferences
182
173
csharp_prefer_static_local_function = true :warning
183
- csharp_prefer_simple_using_statement = true :suggestion
184
174
185
175
# #########################################
186
- # .NET Formatting Conventions
187
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- code-style-settings-reference#formatting-conventions
176
+ # Unnecessary Code Rules
177
+ # https://docs.microsoft.com/dotnet/fundamentals/ code-analysis/ style-rules/unnecessary-code-rules
188
178
# #########################################
189
179
190
- # Organize usings
191
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives
180
+ # .NET Unnecessary code rules
181
+ [* .{cs,csx,cake,vb,vbx} ]
182
+ dotnet_code_quality_unused_parameters = all:warning
183
+ dotnet_remove_unnecessary_suppression_exclusions = none:warning
184
+
185
+ # C# Unnecessary code rules
186
+ [* .{cs,csx,cake} ]
187
+ csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
188
+ dotnet_diagnostic.IDE0058.severity = suggestion
189
+ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
190
+ dotnet_diagnostic.IDE0059.severity = suggestion
191
+
192
+ # #########################################
193
+ # Formatting Rules
194
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules
195
+ # #########################################
196
+
197
+ # .NET formatting rules
198
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#net-formatting-rules
199
+ [* .{cs,csx,cake,vb,vbx} ]
200
+ # Organize using directives
192
201
dotnet_sort_system_directives_first = true
202
+ dotnet_separate_import_directive_groups = false
203
+
204
+ # C# formatting rules
205
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
206
+ [* .{cs,csx,cake} ]
193
207
# Newline options
194
208
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
195
209
csharp_new_line_before_open_brace = all
@@ -231,14 +245,14 @@ csharp_space_around_declaration_statements = false
231
245
csharp_space_before_open_square_brackets = false
232
246
csharp_space_between_empty_square_brackets = false
233
247
csharp_space_between_square_brackets = false
234
- # Wrapping options
248
+ # Wrap options
235
249
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
236
250
csharp_preserve_single_line_statements = false
237
251
csharp_preserve_single_line_blocks = true
238
252
239
253
# #########################################
240
- # .NET Naming Conventions
241
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- naming-conventions
254
+ # .NET Naming Rules
255
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ naming-rules
242
256
# #########################################
243
257
244
258
[* .{cs,csx,cake,vb,vbx} ]
@@ -261,8 +275,9 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_
261
275
dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
262
276
# disallowed_style - Anything that has this style applied is marked as disallowed
263
277
dotnet_naming_style.disallowed_style.capitalization = pascal_case
264
- dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
265
- dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
278
+ # Disabled while we investigate compatibility with VS 16.10
279
+ # dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
280
+ # dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
266
281
# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
267
282
dotnet_naming_style.internal_error_style.capitalization = pascal_case
268
283
dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____
0 commit comments