@@ -55,15 +55,12 @@ indent_size = 2
5555
5656# Dotnet code style settings:
5757[* .{cs,vb} ]
58- # Use block-scoped namespace
59- csharp_style_namespace_declarations = block_scoped:error
60- dotnet_diagnostic.IDE0160.severity = error
61- dotnet_diagnostic.IDE0161.severity = error
58+ # Use file-scoped namespace
59+ csharp_style_namespace_declarations = file_scoped:warning
6260
6361# Member can be made 'readonly'
6462csharp_style_prefer_readonly_struct_member = true
6563dotnet_diagnostic.IDE0251.severity = warning
66- dotnet_diagnostic.IDE0044.severity = warning
6764
6865dotnet_diagnostic.CS1591.severity = silent
6966// Use primary constructor
@@ -89,6 +86,7 @@ dotnet_style_collection_initializer = true:warning
8986dotnet_style_coalesce_expression = true :suggestion
9087dotnet_style_null_propagation = true :suggestion
9188dotnet_style_explicit_tuple_names = true :suggestion
89+ dotnet_style_prefer_collection_expression = never
9290
9391# Whitespace options
9492dotnet_style_allow_multiple_blank_lines_experimental = false
@@ -115,46 +113,6 @@ dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
115113
116114dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
117115
118- # Constants are PascalCase
119- dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
120- dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
121- dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
122-
123- dotnet_naming_symbols.constants.applicable_kinds = field, local
124- dotnet_naming_symbols.constants.required_modifiers = const
125-
126- dotnet_naming_style.constant_style.capitalization = pascal_case
127-
128- # Static fields are camelCase and start with s_
129- dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
130- dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
131- dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
132-
133- dotnet_naming_symbols.static_fields.applicable_kinds = field
134- dotnet_naming_symbols.static_fields.required_modifiers = static
135-
136- dotnet_naming_style.static_field_style.capitalization = camel_case
137- dotnet_naming_style.static_field_style.required_prefix = s_
138-
139- # Instance fields are camelCase and start with _
140- dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
141- dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
142- dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
143-
144- dotnet_naming_symbols.instance_fields.applicable_kinds = field
145-
146- dotnet_naming_style.instance_field_style.capitalization = camel_case
147- dotnet_naming_style.instance_field_style.required_prefix = _
148-
149- # Locals and parameters are camelCase
150- dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
151- dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
152- dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
153-
154- dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
155-
156- dotnet_naming_style.camel_case_style.capitalization = camel_case
157-
158116# Local functions are PascalCase
159117dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
160118dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
@@ -164,19 +122,10 @@ dotnet_naming_symbols.local_functions.applicable_kinds = local_function
164122
165123dotnet_naming_style.local_function_style.capitalization = pascal_case
166124
167- # By default, name items with PascalCase
168- dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
169- dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
170- dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
171-
172- dotnet_naming_symbols.all_members.applicable_kinds = *
173-
174- dotnet_naming_style.pascal_case_style.capitalization = pascal_case
175-
176125file_header_template = Copyright (C) 2015 -2025 The Neo Project.\n\n{fileName} file belongs to the neo project and is free\nsoftware distributed under the MIT software license, see the\naccompanying file LICENSE in the main directory of the\nrepository or http://www.opensource.org/licenses/mit-license.php\nfor more details.\n\nRedistribution and use in source and binary forms with or without\nmodifications are permitted.
177126
178127# Require file header
179- dotnet_diagnostic.IDE0073.severity = error
128+ dotnet_diagnostic.IDE0073.severity = warning
180129
181130# RS0016: Only enable if API files are present
182131dotnet_public_api_analyzer.require_api_files = true
@@ -211,11 +160,6 @@ csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimenta
211160csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
212161csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
213162
214- # Prefer "var" everywhere
215- csharp_style_var_for_built_in_types = true :suggestion
216- csharp_style_var_when_type_is_apparent = true :suggestion
217- csharp_style_var_elsewhere = true :suggestion
218-
219163# Prefer method-like constructs to have a block body
220164csharp_style_expression_bodied_methods = false :none
221165csharp_style_expression_bodied_constructors = false :none
@@ -226,6 +170,9 @@ csharp_style_expression_bodied_properties = true:none
226170csharp_style_expression_bodied_indexers = true :none
227171csharp_style_expression_bodied_accessors = true :none
228172
173+ # IDE0230: Use UTF-8 string literal
174+ csharp_style_prefer_utf8_string_literals = true :silent
175+
229176# Suggest more modern language features when available
230177csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
231178csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
@@ -268,9 +215,6 @@ dotnet_diagnostic.IDE0060.severity = none
268215
269216[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures,VisualStudio}/** /* .{cs,vb} ]
270217
271- # Use collection expression for array
272- dotnet_diagnostic.IDE0300.severity = warning
273-
274218# Avoid "this." and "Me." if not necessary
275219dotnet_diagnostic.IDE0003.severity = warning
276220dotnet_diagnostic.IDE0009.severity = warning
@@ -289,18 +233,15 @@ dotnet_diagnostic.IDE0052.severity = warning
289233# IDE0059: Unnecessary assignment to a value
290234dotnet_diagnostic.IDE0059.severity = warning
291235
236+ # Use collection expression for array
237+ dotnet_diagnostic.IDE0300.severity = warning
238+
292239# CA1012: Abstract types should not have public constructors
293240dotnet_diagnostic.CA1012.severity = warning
294241
295242# CA1822: Make member static
296243dotnet_diagnostic.CA1822.severity = warning
297244
298- # Prefer "var" everywhere
299- dotnet_diagnostic.IDE0007.severity = warning
300- csharp_style_var_for_built_in_types = true :warning
301- csharp_style_var_when_type_is_apparent = true :warning
302- csharp_style_var_elsewhere = true :warning
303-
304245# csharp_style_allow_embedded_statements_on_same_line_experimental
305246dotnet_diagnostic.IDE2001.severity = warning
306247
0 commit comments