4
4
5
5
root = true
6
6
7
- # XML project files
8
- [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
9
- indent_size = 2
10
- insert_final_newline = true
11
- trim_trailing_whitespace = true
12
-
13
- # XML config files
14
- [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
15
- indent_size = 2
16
- insert_final_newline = true
17
- trim_trailing_whitespace = true
18
-
19
- # Code files
20
- [* .{cs,csx,vb,vbx} ]
21
- indent_size = 4
22
- insert_final_newline = true
23
- trim_trailing_whitespace = true
24
- charset = utf-8-bom
25
-
26
7
# ##############################
27
8
# .NET Coding Conventions #
28
9
# ##############################
29
10
30
11
[* .{cs,vb} ]
31
12
# Organize usings
32
- dotnet_sort_system_directives_first = true :error
33
- dotnet_separate_import_directive_groups = true :error
13
+ dotnet_sort_system_directives_first = true :warning
14
+ dotnet_separate_import_directive_groups = true :warning
34
15
35
16
# this. preferences
36
- dotnet_style_qualification_for_field = true :error
37
- dotnet_style_qualification_for_property = true :error
38
- dotnet_style_qualification_for_method = true :error
39
- dotnet_style_qualification_for_event = true :error
17
+ dotnet_style_qualification_for_field = true :warning
18
+ dotnet_style_qualification_for_property = true :warning
19
+ dotnet_style_qualification_for_method = true :warning
20
+ dotnet_style_qualification_for_event = true :warning
40
21
41
22
# Language keywords vs BCL types preferences
42
- dotnet_style_predefined_type_for_locals_parameters_members = true :error
43
- dotnet_style_predefined_type_for_member_access = true :error
23
+ dotnet_style_predefined_type_for_locals_parameters_members = true :warning
24
+ dotnet_style_predefined_type_for_member_access = true :warning
44
25
45
26
# Parentheses preferences
46
- dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
47
- dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
48
- dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
49
- dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
27
+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
28
+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
29
+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
30
+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
50
31
51
32
# Modifier preferences
52
- dotnet_style_require_accessibility_modifiers = always:error
53
- dotnet_style_readonly_field = true :error
33
+ dotnet_style_require_accessibility_modifiers = always:warning
34
+ dotnet_style_readonly_field = true :warning
54
35
55
36
# Expression-level preferences
56
- dotnet_style_object_initializer = true :error
57
- dotnet_style_collection_initializer = true :error
58
- dotnet_style_explicit_tuple_names = true :error
59
- dotnet_style_null_propagation = true :error
60
- dotnet_style_coalesce_expression = true :error
61
- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :error
62
- dotnet_style_prefer_inferred_tuple_names = true :error
63
- dotnet_style_prefer_inferred_anonymous_type_member_names = true :error
64
- dotnet_style_prefer_auto_properties = true :error
65
- dotnet_style_prefer_conditional_expression_over_assignment = true :error
66
- dotnet_style_prefer_conditional_expression_over_return = true :error
37
+ dotnet_style_object_initializer = true :warning
38
+ dotnet_style_collection_initializer = false :warning
39
+ dotnet_style_prefer_collection_expression = false :warning
40
+ dotnet_style_explicit_tuple_names = true :warning
41
+ dotnet_style_null_propagation = true :warning
42
+ dotnet_style_coalesce_expression = true :warning
43
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
44
+ dotnet_style_prefer_inferred_tuple_names = true :warning
45
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :warning
46
+ dotnet_style_prefer_auto_properties = true :warning
47
+ dotnet_style_prefer_conditional_expression_over_assignment = true :warning
48
+ dotnet_style_prefer_conditional_expression_over_return = true :warning
67
49
68
50
# Namespace preferences
69
- csharp_style_namespace_declarations = file_scoped:error
51
+ csharp_style_namespace_declarations = file_scoped:warning
70
52
71
53
# ##############################
72
54
# Naming Conventions #
@@ -77,15 +59,15 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
77
59
dotnet_style_allow_multiple_blank_lines_experimental = false
78
60
79
61
# Use PascalCase for constant fields
80
- dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
62
+ dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
81
63
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
82
64
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
83
65
dotnet_naming_symbols.constant_fields.applicable_kinds = field
84
66
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
85
67
dotnet_naming_symbols.constant_fields.required_modifiers = const
86
68
87
69
# Use PascalCase for public members (properties, methods, events)
88
- dotnet_naming_rule.public_members_should_be_pascal_case.severity = error
70
+ dotnet_naming_rule.public_members_should_be_pascal_case.severity = warning
89
71
dotnet_naming_rule.public_members_should_be_pascal_case.symbols = public_members
90
72
dotnet_naming_rule.public_members_should_be_pascal_case.style = pascal_case_style
91
73
dotnet_naming_symbols.public_members.applicable_kinds = property,method,event,field
@@ -94,7 +76,7 @@ dotnet_naming_symbols.public_members.applicable_accessibilities = public,protect
94
76
# Use camelCase with '_' prefix for private fields
95
77
dotnet_naming_style.underscore_prefix_style.capitalization = camel_case
96
78
dotnet_naming_style.underscore_prefix_style.required_prefix = _
97
- dotnet_naming_rule.private_fields_should_have_underscore_prefix.severity = error
79
+ dotnet_naming_rule.private_fields_should_have_underscore_prefix.severity = warning
98
80
dotnet_naming_rule.private_fields_should_have_underscore_prefix.symbols = private_fields
99
81
dotnet_naming_rule.private_fields_should_have_underscore_prefix.style = underscore_prefix_style
100
82
dotnet_naming_symbols.private_fields.applicable_kinds = field
@@ -104,93 +86,56 @@ dotnet_naming_symbols.private_fields.applicable_accessibilities = private
104
86
# Analyzers #
105
87
# ##############################
106
88
107
- dotnet_analyzer_diagnostic.category-CodeQuality.severity = error
108
- dotnet_analyzer_diagnostic.category-Documentation.severity = error
109
- dotnet_analyzer_diagnostic.category-Design.severity = error
110
- dotnet_analyzer_diagnostic.category-Performance.severity = error
111
- dotnet_analyzer_diagnostic.category-Reliability.severity = error
112
- dotnet_analyzer_diagnostic.category-Security.severity = error
113
- dotnet_analyzer_diagnostic.category-Style.severity = error
89
+ dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning
90
+ dotnet_analyzer_diagnostic.category-Documentation.severity = warning
91
+ dotnet_analyzer_diagnostic.category-Design.severity = warning
92
+ dotnet_analyzer_diagnostic.category-Performance.severity = warning
93
+ dotnet_analyzer_diagnostic.category-Reliability.severity = warning
94
+ dotnet_analyzer_diagnostic.category-Security.severity = warning
95
+ dotnet_analyzer_diagnostic.category-Style.severity = warning
114
96
115
97
# Explicit code exclusions
116
98
# Namespace does not match folder structure
117
99
dotnet_diagnostic.IDE0130.severity = none
118
- # Collection initialization can be simplified
119
- dotnet_diagnostic.IDE0301.severity = none
120
- dotnet_diagnostic.IDE0300.severity = none
121
- dotnet_diagnostic.IDE0305.severity = none
122
100
# If statement can be simplified
123
101
dotnet_diagnostic.IDE0046.severity = none
124
102
dotnet_diagnostic.IDE0045.severity = none
125
103
# Use switch expression
126
104
dotnet_diagnostic.IDE0066.severity = none
105
+ # Use collection initializers or expressions
106
+ # dotnet_diagnostic.IDE0028.severity = none
127
107
128
108
# ##############################
129
109
# C# Coding Conventions #
130
110
# ##############################
131
111
[* .cs ]
132
112
# var preferences
133
- csharp_style_var_for_built_in_types = true :error
134
- csharp_style_var_when_type_is_apparent = true :error
135
- csharp_style_var_elsewhere = true :error
113
+ csharp_style_var_for_built_in_types = true :warning
114
+ csharp_style_var_when_type_is_apparent = true :warning
115
+ csharp_style_var_elsewhere = true :warning
136
116
137
117
# Expression-bodied members
138
- csharp_style_expression_bodied_methods = when_possible:error
139
- csharp_style_expression_bodied_constructors = when_possible:error
140
- csharp_style_expression_bodied_operators = when_possible:error
141
- csharp_style_expression_bodied_properties = when_possible:error
142
- csharp_style_expression_bodied_indexers = when_possible:error
143
- csharp_style_expression_bodied_accessors = when_possible:error
118
+ csharp_style_expression_bodied_methods = when_possible:warning
119
+ csharp_style_expression_bodied_constructors = when_possible:warning
120
+ csharp_style_expression_bodied_operators = when_possible:warning
121
+ csharp_style_expression_bodied_properties = when_possible:warning
122
+ csharp_style_expression_bodied_indexers = when_possible:warning
123
+ csharp_style_expression_bodied_accessors = when_possible:warning
144
124
145
125
# Pattern matching preferences
146
- csharp_style_pattern_matching_over_is_with_cast_check = true :error
147
- csharp_style_pattern_matching_over_as_with_null_check = true :error
126
+ csharp_style_pattern_matching_over_is_with_cast_check = true :warning
127
+ csharp_style_pattern_matching_over_as_with_null_check = true :warning
148
128
149
129
# Null-checking preferences
150
- csharp_style_throw_expression = true :error
151
- csharp_style_conditional_delegate_call = true :error
130
+ csharp_style_throw_expression = true :warning
131
+ csharp_style_conditional_delegate_call = true :warning
152
132
153
133
# Modifier preferences
154
134
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
155
135
156
136
# Expression-level preferences
157
- csharp_prefer_braces = true :error
158
- csharp_style_deconstructed_variable_declaration = true :error
159
- csharp_prefer_simple_default_expression = true :error
160
- csharp_style_pattern_local_over_anonymous_function = true :error
161
- csharp_style_inlined_variable_declaration = true :error
162
-
163
- # ##############################
164
- # C# Formatting Rules #
165
- # ##############################
166
-
167
- # New line preferences
168
- csharp_new_line_before_open_brace = all
169
- csharp_new_line_before_else = true
170
- csharp_new_line_before_catch = true
171
- csharp_new_line_before_finally = true
172
- csharp_new_line_before_members_in_object_initializers = true
173
- csharp_new_line_before_members_in_anonymous_types = true
174
- csharp_new_line_between_query_expression_clauses = true
175
-
176
- # Indentation preferences
177
- csharp_indent_case_contents = true
178
- csharp_indent_switch_labels = true
179
- csharp_indent_labels = flush_left
180
-
181
- # Space preferences
182
- csharp_space_after_cast = false
183
- csharp_space_after_keywords_in_control_flow_statements = true
184
- csharp_space_between_method_call_parameter_list_parentheses = false
185
- csharp_space_between_method_declaration_parameter_list_parentheses = false
186
- csharp_space_between_parentheses = false
187
- csharp_space_before_colon_in_inheritance_clause = true
188
- csharp_space_after_colon_in_inheritance_clause = true
189
- csharp_space_around_binary_operators = before_and_after
190
- csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
191
- csharp_space_between_method_call_name_and_opening_parenthesis = false
192
- csharp_space_between_method_call_empty_parameter_list_parentheses = false
193
-
194
- # Wrapping preferences
195
- csharp_preserve_single_line_statements = true
196
- csharp_preserve_single_line_blocks = true
137
+ csharp_prefer_braces = true :warning
138
+ csharp_style_deconstructed_variable_declaration = true :warning
139
+ csharp_prefer_simple_default_expression = false :warning
140
+ csharp_style_pattern_local_over_anonymous_function = true :warning
141
+ csharp_style_inlined_variable_declaration = true :warning
0 commit comments