yarp-swagger

Форк
0
/
.editorconfig 
260 строк · 11.6 Кб
1
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2
root = true
3

4
# C# files
5
[*.cs]
6

7
# Here we set all microsoft's IDExxxx rule violations as compile errors
8
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/
9
dotnet_analyzer_diagnostic.category-Style.severity = error
10

11
# Here we ignore some rule violdations that they are not really important for us
12
dotnet_diagnostic.IDE0008.severity = silent # Explicit type, not var
13
dotnet_diagnostic.IDE0010.severity = silent # missing cases to "case" switch expression
14
dotnet_diagnostic.IDE0039.severity = silent # lambda vs local function
15
dotnet_diagnostic.IDE0045.severity = silent # Use ternary for assignment, not ifs
16
dotnet_diagnostic.IDE0046.severity = silent # Use ternary for returns, not ifs
17
dotnet_diagnostic.IDE0055.severity = silent # Generic formatting errors: should be handled by csharpier
18
dotnet_diagnostic.IDE0058.severity = silent # Expression value is never used
19
dotnet_diagnostic.IDE0072.severity = silent # missing cases to "=>" switch expression
20
dotnet_diagnostic.IDE0090.severity = silent # Use implicit new
21
dotnet_diagnostic.IDE0270.severity = silent # Simplify null check
22
# https://github.com/dotnet/aspnetcore/issues/47912
23
dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary using directives (using CS8019 instead)
24
dotnet_diagnostic.CS8019.severity = error # Remove unnecessary using directives
25
dotnet_diagnostic.CS8618.severity = error # Non-nullable property must contain a non-null value
26

27

28
# Here we set some rules for unused codes (classes, methods, parameters, etc.)
29
dotnet_diagnostic.CA1801.severity = error # Review unused parameters
30
dotnet_diagnostic.CA1804.severity = error # Remove unused locals
31
dotnet_diagnostic.CA1811.severity = error # Avoid uncalled private code
32
dotnet_diagnostic.CA1823.severity = error # Avoid unused private fields
33

34

35
#### Core EditorConfig Options ####
36

37
# Indentation and spacing
38
indent_size = 4
39
indent_style = space
40
tab_width = 4
41

42
#### .NET Coding Conventions ####
43

44
# Organize usings
45
dotnet_separate_import_directive_groups = false
46
dotnet_sort_system_directives_first = false
47
file_header_template = unset
48

49
# this. and Me. preferences
50
dotnet_style_qualification_for_event = false
51
dotnet_style_qualification_for_field = false:error
52
dotnet_style_qualification_for_method = false:error
53
dotnet_style_qualification_for_property = false:error
54

55
# Language keywords vs BCL types preferences
56
dotnet_style_predefined_type_for_locals_parameters_members = true
57
dotnet_style_predefined_type_for_member_access = true
58

59
# Parentheses preferences
60
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary
61
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary
62
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
63
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary
64

65
# Modifier preferences
66
dotnet_style_require_accessibility_modifiers = for_non_interface_members
67

68
# Expression-level preferences
69
dotnet_style_coalesce_expression = true
70
dotnet_style_collection_initializer = true
71
dotnet_style_explicit_tuple_names = true
72
dotnet_style_namespace_match_folder = true
73
dotnet_style_null_propagation = true
74
dotnet_style_object_initializer = true
75
dotnet_style_operator_placement_when_wrapping = beginning_of_line
76
dotnet_style_prefer_auto_properties = true
77
dotnet_style_prefer_compound_assignment = true
78
dotnet_style_prefer_conditional_expression_over_assignment = true
79
dotnet_style_prefer_conditional_expression_over_return = true
80
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
81
dotnet_style_prefer_inferred_anonymous_type_member_names = true
82
dotnet_style_prefer_inferred_tuple_names = true
83
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
84
dotnet_style_prefer_simplified_boolean_expressions = true
85
dotnet_style_prefer_simplified_interpolation = true
86

87
# Field preferences
88
dotnet_style_readonly_field = true
89

90
# Parameter preferences
91
dotnet_code_quality_unused_parameters = all
92

93
# Suppression preferences
94
dotnet_remove_unnecessary_suppression_exclusions = none
95

96
# New line preferences
97
dotnet_style_allow_multiple_blank_lines_experimental = true
98
dotnet_style_allow_statement_immediately_after_block_experimental = true
99

100
#### C# Coding Conventions ####
101

102
# var preferences
103
csharp_style_var_elsewhere = false:silent
104
csharp_style_var_for_built_in_types = false:silent
105
csharp_style_var_when_type_is_apparent = false:silent
106

107
# Expression-bodied members
108
csharp_style_expression_bodied_accessors = true:silent
109
csharp_style_expression_bodied_constructors = false:silent
110
csharp_style_expression_bodied_indexers = true:silent
111
csharp_style_expression_bodied_lambdas = true:silent
112
csharp_style_expression_bodied_local_functions = false:silent
113
csharp_style_expression_bodied_methods = when_on_single_line:none
114
csharp_style_expression_bodied_operators = false:silent
115
csharp_style_expression_bodied_properties = true:silent
116

117
# Pattern matching preferences
118
csharp_style_pattern_matching_over_as_with_null_check = false
119
csharp_style_pattern_matching_over_is_with_cast_check = false
120
csharp_style_prefer_extended_property_pattern = false
121
csharp_style_prefer_not_pattern = false
122
csharp_style_prefer_pattern_matching = false
123
csharp_style_prefer_switch_expression = false
124

125
# Null-checking preferences
126
csharp_style_conditional_delegate_call = true
127

128
# Modifier preferences
129
csharp_prefer_static_local_function = true
130
csharp_preferred_modifier_order = public, private, protected, internal, file, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, required, volatile, async
131
csharp_style_prefer_readonly_struct = true
132

133
# Code-block preferences
134
csharp_prefer_braces = when_multiline:error
135
csharp_prefer_simple_using_statement = false:silent
136
csharp_style_namespace_declarations = false:silent
137
csharp_style_prefer_method_group_conversion = true:silent
138
csharp_style_prefer_top_level_statements = true:silent
139

140
# Expression-level preferences
141
csharp_prefer_simple_default_expression = true
142
csharp_style_deconstructed_variable_declaration = true
143
csharp_style_implicit_object_creation_when_type_is_apparent = false
144
csharp_style_inlined_variable_declaration = true
145
csharp_style_prefer_index_operator = true
146
csharp_style_prefer_local_over_anonymous_function = true
147
csharp_style_prefer_null_check_over_type_check = true
148
csharp_style_prefer_range_operator = true
149
csharp_style_prefer_tuple_swap = true
150
csharp_style_prefer_utf8_string_literals = true
151
csharp_style_throw_expression = true
152
csharp_style_unused_value_assignment_preference = discard_variable
153
csharp_style_unused_value_expression_statement_preference = discard_variable
154

155
# 'using' directive preferences
156
csharp_using_directive_placement = outside_namespace:silent
157

158
# New line preferences
159
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
160
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
161
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
162
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
163
csharp_style_allow_embedded_statements_on_same_line_experimental = true
164

165
#### C# Formatting Rules ####
166
# All handled by csharpier
167

168
#### Naming styles ####
169

170
# Naming rules
171

172
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
173
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
174
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
175

176
dotnet_naming_rule.types_should_be_pascal_case.severity = error
177
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
178
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
179

180
dotnet_naming_rule.constant_should_be_capitalized_snake_case.severity = error
181
dotnet_naming_rule.constant_should_be_capitalized_snake_case.symbols = constant
182
dotnet_naming_rule.constant_should_be_capitalized_snake_case.style = capitalized_snake_case
183

184
dotnet_naming_rule.readonly_should_be_begins_with__.severity = error
185
dotnet_naming_rule.readonly_should_be_begins_with__.symbols = readonly
186
dotnet_naming_rule.readonly_should_be_begins_with__.style = begins_with__
187

188
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error
189
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
190
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
191

192
dotnet_naming_rule.private_or_internal_field_should_be_camel_case.severity = error
193
dotnet_naming_rule.private_or_internal_field_should_be_camel_case.symbols = private_or_internal_field
194
dotnet_naming_rule.private_or_internal_field_should_be_camel_case.style = camel_case
195

196
# Symbol specifications
197

198
dotnet_naming_symbols.interface.applicable_kinds = interface
199
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
200
dotnet_naming_symbols.interface.required_modifiers =
201

202
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
203
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
204
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
205

206
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
207
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
208
dotnet_naming_symbols.types.required_modifiers =
209

210
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
211
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
212
dotnet_naming_symbols.non_field_members.required_modifiers =
213

214
dotnet_naming_symbols.constant.applicable_kinds = field
215
dotnet_naming_symbols.constant.applicable_accessibilities = public, internal, private
216
dotnet_naming_symbols.constant.required_modifiers = const
217

218
dotnet_naming_symbols.readonly.applicable_kinds = field
219
dotnet_naming_symbols.readonly.applicable_accessibilities = public, private
220
dotnet_naming_symbols.readonly.required_modifiers = readonly
221

222
# Naming styles
223

224
dotnet_naming_style.pascal_case.required_prefix =
225
dotnet_naming_style.pascal_case.required_suffix =
226
dotnet_naming_style.pascal_case.word_separator =
227
dotnet_naming_style.pascal_case.capitalization = pascal_case
228

229
dotnet_naming_style.begins_with_i.required_prefix = I
230
dotnet_naming_style.begins_with_i.required_suffix =
231
dotnet_naming_style.begins_with_i.word_separator =
232
dotnet_naming_style.begins_with_i.capitalization = pascal_case
233

234
dotnet_naming_style.camel_case.required_prefix =
235
dotnet_naming_style.camel_case.required_suffix =
236
dotnet_naming_style.camel_case.word_separator =
237
dotnet_naming_style.camel_case.capitalization = camel_case
238

239
dotnet_naming_style.capitalized_snake_case.required_prefix =
240
dotnet_naming_style.capitalized_snake_case.required_suffix =
241
dotnet_naming_style.capitalized_snake_case.word_separator = _
242
dotnet_naming_style.capitalized_snake_case.capitalization = all_upper
243

244
dotnet_naming_style.begins_with__.required_prefix = _
245
dotnet_naming_style.begins_with__.required_suffix =
246
dotnet_naming_style.begins_with__.word_separator =
247
dotnet_naming_style.begins_with__.capitalization = camel_case
248

249
[*.{cs,vb}]
250
dotnet_style_operator_placement_when_wrapping = beginning_of_line
251
tab_width = 4
252
indent_size = 4
253
dotnet_style_coalesce_expression = true:suggestion
254
dotnet_style_null_propagation = true:suggestion
255
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
256
dotnet_style_prefer_auto_properties = true:silent
257
dotnet_style_object_initializer = true:suggestion
258
dotnet_style_collection_initializer = true:suggestion
259
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
260
dotnet_style_prefer_conditional_expression_over_assignment = true:silent

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.