@@ -65,28 +65,33 @@ end_of_line = lf
6565
6666# .NET Code Style Settings
6767[* .{cs,csx,cake,vb} ]
68+
6869# "this." and "Me." qualifiers
6970# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me
70- dotnet_style_qualification_for_field = true :warning
71- dotnet_style_qualification_for_property = true :warning
72- dotnet_style_qualification_for_method = true :warning
73- dotnet_style_qualification_for_event = true :warning
71+ dotnet_style_qualification_for_field = false :warning
72+ dotnet_style_qualification_for_property = false :warning
73+ dotnet_style_qualification_for_method = false :warning
74+ dotnet_style_qualification_for_event = false :warning
75+
7476# Language keywords instead of framework type names for type references
7577# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords
7678dotnet_style_predefined_type_for_locals_parameters_members = true :warning
7779dotnet_style_predefined_type_for_member_access = true :warning
80+
7881# Modifier preferences
7982# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers
8083dotnet_style_require_accessibility_modifiers = always:warning
8184csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
8285visual_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
8386dotnet_style_readonly_field = true :warning
87+
8488# Parentheses preferences
8589# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#parentheses
8690dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
8791dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
8892dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
8993dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
94+
9095# Expression-level preferences
9196# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level
9297dotnet_style_object_initializer = true :warning
@@ -98,18 +103,21 @@ dotnet_style_prefer_auto_properties = true:warning
98103dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
99104dotnet_style_prefer_conditional_expression_over_assignment = false :suggestion
100105dotnet_style_prefer_conditional_expression_over_return = false :suggestion
106+
101107# Null-checking preferences
102108# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking
103109dotnet_style_coalesce_expression = true :warning
104110dotnet_style_null_propagation = true :warning
105111
106112# C# Code Style Settings
107113[* .{cs,csx,cake} ]
114+
108115# Implicit and explicit types
109116# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types
110117csharp_style_var_for_built_in_types = true :warning
111118csharp_style_var_when_type_is_apparent = true :warning
112119csharp_style_var_elsewhere = true :warning
120+
113121# Expression-bodied members
114122# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members
115123csharp_style_expression_bodied_methods = true :warning
@@ -118,25 +126,31 @@ csharp_style_expression_bodied_operators = true:warning
118126csharp_style_expression_bodied_properties = true :warning
119127csharp_style_expression_bodied_indexers = true :warning
120128csharp_style_expression_bodied_accessors = true :warning
129+
121130# Pattern matching
122131# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching
123132csharp_style_pattern_matching_over_is_with_cast_check = true :warning
124133csharp_style_pattern_matching_over_as_with_null_check = true :warning
134+
125135# Inlined variable declarations
126136# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations
127137csharp_style_inlined_variable_declaration = true :warning
138+
128139# Expression-level preferences
129140# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp
130141csharp_prefer_simple_default_expression = true :warning
131142csharp_style_deconstructed_variable_declaration = true :warning
132143csharp_style_pattern_local_over_anonymous_function = true :warning
144+
133145# "Null" checking preferences
134146# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp
135147csharp_style_throw_expression = true :warning
136148csharp_style_conditional_delegate_call = true :warning
149+
137150# Code block preferences
138151# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block
139152csharp_prefer_braces = true :warning
153+ csharp_style_prefer_top_level_statements = false :warning
140154
141155# ############################
142156# .NET Formatting Conventions
@@ -146,6 +160,7 @@ csharp_prefer_braces = true:warning
146160# Organize usings
147161# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings
148162dotnet_sort_system_directives_first = true
163+
149164# C# formatting settings
150165# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings
151166csharp_new_line_before_open_brace = all
@@ -155,31 +170,36 @@ csharp_new_line_before_finally = true
155170csharp_new_line_before_members_in_object_initializers = true
156171csharp_new_line_before_members_in_anonymous_types = true
157172csharp_new_line_between_query_expression_clauses = true
173+
158174# Indentation options
159175# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent
160176csharp_indent_case_contents = true
161177csharp_indent_switch_labels = true
162178csharp_indent_labels = no_change
179+
163180# Spacing options
164181# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing
165182csharp_space_after_cast = false
166183csharp_space_after_keywords_in_control_flow_statements = true
167184csharp_space_between_method_declaration_parameter_list_parentheses = false
168185csharp_space_between_method_call_parameter_list_parentheses = false
169- csharp_space_between_parentheses = expressions
186+ csharp_space_between_parentheses = false
170187csharp_space_before_colon_in_inheritance_clause = true
171188csharp_space_after_colon_in_inheritance_clause = true
172189csharp_space_around_binary_operators = before_and_after
173190csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
174191csharp_space_between_method_call_name_and_opening_parenthesis = false
175192csharp_space_between_method_call_empty_parameter_list_parentheses = false
193+
176194# Wrapping options
177195# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping
178196csharp_preserve_single_line_statements = false
179197csharp_preserve_single_line_blocks = true
198+
180199# More Indentation options (Undocumented)
181200csharp_indent_block_contents = true
182201csharp_indent_braces = false
202+
183203# Spacing Options (Undocumented)
184204csharp_space_after_comma = true
185205csharp_space_after_dot = false
@@ -199,86 +219,135 @@ csharp_space_between_square_brackets = false
199219# ########################
200220
201221[* .{cs,csx,cake,vb} ]
222+
202223# Naming Symbols
224+
203225# constant_fields - Define constant fields
204226dotnet_naming_symbols.constant_fields.applicable_kinds = field
205227dotnet_naming_symbols.constant_fields.required_modifiers = const
228+
206229# non_private_readonly_fields - Define public, internal and protected readonly fields
207230dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected
208231dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
209232dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
233+
210234# static_readonly_fields - Define static and readonly fields
211235dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
212236dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly
237+
213238# private_readonly_fields - Define private readonly fields
214239dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private
215240dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field
216241dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly
242+
217243# public_internal_fields - Define public and internal fields
218244dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal
219245dotnet_naming_symbols.public_internal_fields.applicable_kinds = field
220- # private_protected_fields - Define private and protected fields
221- dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected
222- dotnet_naming_symbols.private_protected_fields.applicable_kinds = field
246+
247+ # protected_fields - Define protected fields
248+ dotnet_naming_symbols.protected_fields.applicable_accessibilities = protected
249+ dotnet_naming_symbols.protected_fields.applicable_kinds = field
250+
251+ # private_fields - Define private fields
252+ dotnet_naming_symbols.private_fields.applicable_accessibilities = private
253+ dotnet_naming_symbols.private_fields.applicable_kinds = field
254+
223255# public_symbols - Define any public symbol
224256dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal
225257dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate
258+
226259# parameters - Defines any parameter
227260dotnet_naming_symbols.parameters.applicable_kinds = parameter
261+
228262# non_interface_types - Defines class, struct, enum and delegate types
229263dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate
264+
230265# interface_types - Defines interfaces
231266dotnet_naming_symbols.interface_types.applicable_kinds = interface
232267
268+ # local_variables - Defines local_variables
269+ dotnet_naming_symbols.local_variables.applicable_kinds = local
270+
233271# Naming Styles
272+
234273# camel_case - Define the camelCase style
235274dotnet_naming_style.camel_case.capitalization = camel_case
275+
276+ # underscored_camel_case - Define the camelCase style with an underscore prefix
277+ dotnet_naming_style.underscored_camel_case.capitalization = camel_case
278+ dotnet_naming_style.underscored_camel_case.required_prefix = _
279+
236280# pascal_case - Define the Pascal_case style
237281dotnet_naming_style.pascal_case.capitalization = pascal_case
282+
238283# first_upper - The first character must start with an upper-case character
239284dotnet_naming_style.first_upper.capitalization = first_word_upper
285+
240286# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I'
241287dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case
242288dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I
243289
244290# Naming Rules
291+
245292# Constant fields must be PascalCase
246293dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning
247294dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields
248295dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case
296+
249297# Public, internal and protected readonly fields must be PascalCase
250298dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = warning
251299dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields
252300dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case
253- # Static readonly fields must be PascalCase
254- dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning
255- dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields
256- dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case
257- # Private readonly fields must be camelCase
258- dotnet_naming_rule.private_readonly_fields_must_be_camel_case.severity = warning
259- dotnet_naming_rule.private_readonly_fields_must_be_camel_case.symbols = private_readonly_fields
260- dotnet_naming_rule.private_readonly_fields_must_be_camel_case.style = camel_case
301+
261302# Public and internal fields must be PascalCase
262303dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = warning
263304dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields
264305dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case
265- # Private and protected fields must be camelCase
266- dotnet_naming_rule.private_protected_fields_must_be_camel_case.severity = warning
267- dotnet_naming_rule.private_protected_fields_must_be_camel_case.symbols = private_protected_fields
268- dotnet_naming_rule.private_protected_fields_must_be_camel_case.style = camel_case
306+
307+ # Protected fields must be camelCase
308+ dotnet_naming_rule.protected_fields_must_be_camel_case.severity = warning
309+ dotnet_naming_rule.protected_fields_must_be_camel_case.symbols = protected_fields
310+ dotnet_naming_rule.protected_fields_must_be_camel_case.style = camel_case
311+
312+ # Private fields must be _camelCase
313+ dotnet_naming_rule.private_fields_must_be_underscored_camel_case.severity = warning
314+ dotnet_naming_rule.private_fields_must_be_underscored_camel_case.symbols = private_fields
315+ dotnet_naming_rule.private_fields_must_be_underscored_camel_case.style = underscored_camel_case
316+
269317# Public members must be capitalized
270318dotnet_naming_rule.public_members_must_be_capitalized.severity = warning
271319dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
272320dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper
321+
273322# Parameters must be camelCase
274323dotnet_naming_rule.parameters_must_be_camel_case.severity = warning
275324dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters
276325dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case
326+
277327# Class, struct, enum and delegates must be PascalCase
278328dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning
279329dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types
280330dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case
331+
281332# Interfaces must be PascalCase and start with an 'I'
282333dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning
283334dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types
284335dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i
336+
337+ # Local variables must be camelCase
338+ dotnet_naming_rule.local_variables_must_be_camel_case.severity = warning
339+ dotnet_naming_rule.local_variables_must_be_camel_case.symbols = local_variables
340+ dotnet_naming_rule.local_variables_must_be_camel_case.style = camel_case
341+
342+ # ###################
343+ # Configure severity
344+ # ###################
345+
346+ # IDE0130: Namespace does not match folder structure
347+ dotnet_diagnostic.IDE0130.severity = suggestion
348+
349+ # IDE0060: Remove unused parameter
350+ dotnet_diagnostic.IDE0060.severity = suggestion
351+
352+ # CA1805: Do not initialize unnecessarily
353+ dotnet_diagnostic.CA1805.severity = warning
0 commit comments