Skip to content

Commit 0bd9aa3

Browse files
committed
添加项目文件。
1 parent 6c438f5 commit 0bd9aa3

26 files changed

+1769
-0
lines changed

.editorconfig

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
# 如果要从更高级别的目录继承 .editorconfig 设置,请删除以下行
2+
root = true
3+
4+
[*]
5+
charset = utf-8-bom
6+
end_of_line = crlf
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
dotnet_style_qualification_for_field = false:silent
11+
dotnet_style_qualification_for_property = false:silent
12+
dotnet_style_qualification_for_method = false:silent
13+
dotnet_style_qualification_for_event = false:silent
14+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
15+
indent_size = 4
16+
tab_width = 4
17+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
18+
19+
# c# 文件
20+
[*.cs]
21+
22+
#### Core EditorConfig 选项 ####
23+
24+
# 缩进和间距
25+
indent_size = 4
26+
tab_width = 4
27+
28+
#### .NET 编码约定 ####
29+
30+
# 组织 Using
31+
dotnet_separate_import_directive_groups = false
32+
dotnet_sort_system_directives_first = true
33+
file_header_template = unset
34+
35+
# this. 和 Me. 首选项
36+
dotnet_style_qualification_for_event = false
37+
dotnet_style_qualification_for_field = false
38+
dotnet_style_qualification_for_method = false
39+
dotnet_style_qualification_for_property = false
40+
41+
# 语言关键字与 bcl 类型首选项
42+
dotnet_style_predefined_type_for_locals_parameters_members = true
43+
dotnet_style_predefined_type_for_member_access = true
44+
45+
# 括号首选项
46+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
47+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
48+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
49+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
50+
51+
# 修饰符首选项
52+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
53+
54+
# 表达式级首选项
55+
dotnet_style_coalesce_expression = true
56+
dotnet_style_collection_initializer = true
57+
dotnet_style_explicit_tuple_names = true
58+
dotnet_style_namespace_match_folder = true
59+
dotnet_style_null_propagation = true
60+
dotnet_style_object_initializer = true
61+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
62+
dotnet_style_prefer_auto_properties = true
63+
dotnet_style_prefer_compound_assignment = true
64+
dotnet_style_prefer_conditional_expression_over_assignment = true
65+
dotnet_style_prefer_conditional_expression_over_return = true
66+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
67+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
68+
dotnet_style_prefer_inferred_tuple_names = true
69+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
70+
dotnet_style_prefer_simplified_boolean_expressions = true
71+
dotnet_style_prefer_simplified_interpolation = true
72+
73+
# 字段首选项
74+
dotnet_style_readonly_field = true
75+
76+
# 参数首选项
77+
dotnet_code_quality_unused_parameters = all
78+
79+
# 禁止显示首选项
80+
dotnet_remove_unnecessary_suppression_exclusions = 0
81+
82+
# 新行首选项
83+
dotnet_style_allow_multiple_blank_lines_experimental = true
84+
dotnet_style_allow_statement_immediately_after_block_experimental = true
85+
86+
#### c# 编码约定 ####
87+
88+
# var 首选项
89+
csharp_style_var_elsewhere = false:silent
90+
csharp_style_var_for_built_in_types = false:silent
91+
csharp_style_var_when_type_is_apparent = false:silent
92+
93+
# Expression-bodied 成员
94+
csharp_style_expression_bodied_accessors = true:silent
95+
csharp_style_expression_bodied_constructors = false:silent
96+
csharp_style_expression_bodied_indexers = true:silent
97+
csharp_style_expression_bodied_lambdas = true:silent
98+
csharp_style_expression_bodied_local_functions = false:silent
99+
csharp_style_expression_bodied_methods = false:silent
100+
csharp_style_expression_bodied_operators = false:silent
101+
csharp_style_expression_bodied_properties = true:silent
102+
103+
# 模式匹配首选项
104+
csharp_style_pattern_matching_over_as_with_null_check = true
105+
csharp_style_pattern_matching_over_is_with_cast_check = true
106+
csharp_style_prefer_extended_property_pattern = true
107+
csharp_style_prefer_not_pattern = true
108+
csharp_style_prefer_pattern_matching = true
109+
csharp_style_prefer_switch_expression = true
110+
111+
# Null 检查首选项
112+
csharp_style_conditional_delegate_call = true:suggestion
113+
114+
# 修饰符首选项
115+
csharp_prefer_static_local_function = true:suggestion
116+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
117+
csharp_style_prefer_readonly_struct = true
118+
119+
# 代码块首选项
120+
csharp_prefer_braces = true:silent
121+
csharp_prefer_simple_using_statement = true:suggestion
122+
csharp_style_namespace_declarations = file_scoped:suggestion
123+
csharp_style_prefer_method_group_conversion = true:silent
124+
csharp_style_prefer_top_level_statements = true:silent
125+
126+
# 表达式级首选项
127+
csharp_prefer_simple_default_expression = true
128+
csharp_style_deconstructed_variable_declaration = true
129+
csharp_style_implicit_object_creation_when_type_is_apparent = true
130+
csharp_style_inlined_variable_declaration = true
131+
csharp_style_prefer_index_operator = true
132+
csharp_style_prefer_local_over_anonymous_function = true
133+
csharp_style_prefer_null_check_over_type_check = true
134+
csharp_style_prefer_range_operator = true
135+
csharp_style_prefer_tuple_swap = true
136+
csharp_style_prefer_utf8_string_literals = true
137+
csharp_style_throw_expression = true
138+
csharp_style_unused_value_assignment_preference = discard_variable
139+
csharp_style_unused_value_expression_statement_preference = discard_variable
140+
141+
# "using" 指令首选项
142+
csharp_using_directive_placement = outside_namespace:silent
143+
144+
# 新行首选项
145+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
146+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
147+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
148+
149+
#### C# 格式规则 ####
150+
151+
# 新行首选项
152+
csharp_new_line_before_catch = true
153+
csharp_new_line_before_else = true
154+
csharp_new_line_before_finally = true
155+
csharp_new_line_before_members_in_anonymous_types = true
156+
csharp_new_line_before_members_in_object_initializers = true
157+
csharp_new_line_before_open_brace = all
158+
csharp_new_line_between_query_expression_clauses = true
159+
160+
# 缩进首选项
161+
csharp_indent_block_contents = true
162+
csharp_indent_braces = false
163+
csharp_indent_case_contents = true
164+
csharp_indent_case_contents_when_block = true
165+
csharp_indent_labels = one_less_than_current
166+
csharp_indent_switch_labels = true
167+
168+
# 空格键首选项
169+
csharp_space_after_cast = false
170+
csharp_space_after_colon_in_inheritance_clause = true
171+
csharp_space_after_comma = true
172+
csharp_space_after_dot = false
173+
csharp_space_after_keywords_in_control_flow_statements = true
174+
csharp_space_after_semicolon_in_for_statement = true
175+
csharp_space_around_binary_operators = before_and_after
176+
csharp_space_around_declaration_statements = false
177+
csharp_space_before_colon_in_inheritance_clause = true
178+
csharp_space_before_comma = false
179+
csharp_space_before_dot = false
180+
csharp_space_before_open_square_brackets = false
181+
csharp_space_before_semicolon_in_for_statement = false
182+
csharp_space_between_empty_square_brackets = false
183+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
184+
csharp_space_between_method_call_name_and_opening_parenthesis = false
185+
csharp_space_between_method_call_parameter_list_parentheses = false
186+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
187+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
188+
csharp_space_between_method_declaration_parameter_list_parentheses = false
189+
csharp_space_between_parentheses = false
190+
csharp_space_between_square_brackets = false
191+
192+
# 包装首选项
193+
csharp_preserve_single_line_blocks = true
194+
csharp_preserve_single_line_statements = true
195+
196+
#### 命名样式 ####
197+
198+
# 命名规则
199+
200+
dotnet_naming_rule.接口_should_be_以i开头.severity = warning
201+
dotnet_naming_rule.接口_should_be_以i开头.symbols = 接口
202+
dotnet_naming_rule.接口_should_be_以i开头.style = 以i开头
203+
204+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.severity = warning
205+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.symbols = 类型_接口_类_枚举_结构体_
206+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.style = pascal_case
207+
208+
dotnet_naming_rule.非字段成员_should_be_pascal_case.severity = warning
209+
dotnet_naming_rule.非字段成员_should_be_pascal_case.symbols = 非字段成员
210+
dotnet_naming_rule.非字段成员_should_be_pascal_case.style = pascal_case
211+
212+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.severity = warning
213+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.symbols = 私有静态只读字段
214+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.style = 以s_为前缀
215+
216+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.severity = warning
217+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.symbols = 公有静态只读字段
218+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.style = pascal_case
219+
220+
dotnet_naming_rule.常量_should_be_pascal_case.severity = warning
221+
dotnet_naming_rule.常量_should_be_pascal_case.symbols = 常量
222+
dotnet_naming_rule.常量_should_be_pascal_case.style = pascal_case
223+
224+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.severity = warning
225+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.symbols = 静态字段
226+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.style = 以s_为前缀
227+
228+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.severity = warning
229+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.symbols = 私有或内部字段
230+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.style = 以_为前缀
231+
232+
dotnet_naming_rule.属性_should_be_pascal_case.severity = warning
233+
dotnet_naming_rule.属性_should_be_pascal_case.symbols = 属性
234+
dotnet_naming_rule.属性_should_be_pascal_case.style = pascal_case
235+
236+
dotnet_naming_rule.方法_should_be_pascal_case.severity = warning
237+
dotnet_naming_rule.方法_should_be_pascal_case.symbols = 方法
238+
dotnet_naming_rule.方法_should_be_pascal_case.style = pascal_case
239+
240+
# 符号规范
241+
242+
dotnet_naming_symbols.接口.applicable_kinds = interface
243+
dotnet_naming_symbols.接口.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
244+
dotnet_naming_symbols.接口.required_modifiers =
245+
246+
dotnet_naming_symbols.方法.applicable_kinds = method
247+
dotnet_naming_symbols.方法.applicable_accessibilities = *
248+
dotnet_naming_symbols.方法.required_modifiers =
249+
250+
dotnet_naming_symbols.属性.applicable_kinds = property
251+
dotnet_naming_symbols.属性.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
252+
dotnet_naming_symbols.属性.required_modifiers =
253+
254+
dotnet_naming_symbols.静态字段.applicable_kinds = field
255+
dotnet_naming_symbols.静态字段.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
256+
dotnet_naming_symbols.静态字段.required_modifiers = static
257+
258+
dotnet_naming_symbols.私有或内部字段.applicable_kinds = field
259+
dotnet_naming_symbols.私有或内部字段.applicable_accessibilities = internal, private, private_protected
260+
dotnet_naming_symbols.私有或内部字段.required_modifiers =
261+
262+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.applicable_kinds = class, struct, interface, enum
263+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
264+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.required_modifiers =
265+
266+
dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method
267+
dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
268+
dotnet_naming_symbols.非字段成员.required_modifiers =
269+
270+
dotnet_naming_symbols.常量.applicable_kinds = field
271+
dotnet_naming_symbols.常量.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
272+
dotnet_naming_symbols.常量.required_modifiers = const
273+
274+
dotnet_naming_symbols.私有静态只读字段.applicable_kinds = field
275+
dotnet_naming_symbols.私有静态只读字段.applicable_accessibilities = private, protected, protected_internal, private_protected
276+
dotnet_naming_symbols.私有静态只读字段.required_modifiers = readonly, static
277+
278+
dotnet_naming_symbols.公有静态只读字段.applicable_kinds = field
279+
dotnet_naming_symbols.公有静态只读字段.applicable_accessibilities = public, internal
280+
dotnet_naming_symbols.公有静态只读字段.required_modifiers = readonly, static
281+
282+
# 命名样式
283+
284+
dotnet_naming_style.pascal_case.required_prefix =
285+
dotnet_naming_style.pascal_case.required_suffix =
286+
dotnet_naming_style.pascal_case.word_separator =
287+
dotnet_naming_style.pascal_case.capitalization = pascal_case
288+
289+
dotnet_naming_style.以i开头.required_prefix = I
290+
dotnet_naming_style.以i开头.required_suffix =
291+
dotnet_naming_style.以i开头.word_separator =
292+
dotnet_naming_style.以i开头.capitalization = pascal_case
293+
294+
dotnet_naming_style.以s_为前缀.required_prefix = s_
295+
dotnet_naming_style.以s_为前缀.required_suffix =
296+
dotnet_naming_style.以s_为前缀.word_separator =
297+
dotnet_naming_style.以s_为前缀.capitalization = camel_case
298+
299+
dotnet_naming_style.以_为前缀.required_prefix = _
300+
dotnet_naming_style.以_为前缀.required_suffix =
301+
dotnet_naming_style.以_为前缀.word_separator =
302+
dotnet_naming_style.以_为前缀.capitalization = camel_case
303+
304+
[*.csproj]
305+
indent_size = 2
306+
tab_width = 2
307+
308+
[*.props]
309+
indent_size = 2
310+
tab_width = 2

0 commit comments

Comments
 (0)