|
@@ -27,93 +27,99 @@ dotnet_sort_system_directives_first = true
|
|
|
file_header_template = unset
|
|
|
|
|
|
# this. 和 Me. 首选项
|
|
|
-dotnet_style_qualification_for_event = false:silent
|
|
|
-dotnet_style_qualification_for_field = false:silent
|
|
|
-dotnet_style_qualification_for_method = false:silent
|
|
|
-dotnet_style_qualification_for_property = false:silent
|
|
|
+dotnet_style_qualification_for_event = false
|
|
|
+dotnet_style_qualification_for_field = false
|
|
|
+dotnet_style_qualification_for_method = false
|
|
|
+dotnet_style_qualification_for_property = false
|
|
|
|
|
|
# 语言关键字与 bcl 类型首选项
|
|
|
-dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
|
|
-dotnet_style_predefined_type_for_member_access = true:silent
|
|
|
+dotnet_style_predefined_type_for_locals_parameters_members = true
|
|
|
+dotnet_style_predefined_type_for_member_access = true
|
|
|
|
|
|
# 括号首选项
|
|
|
-dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
|
|
-dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
|
|
-dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
|
|
-dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
|
|
+dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
|
|
+dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
|
|
+dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
|
|
+dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
|
|
|
|
|
# 修饰符首选项
|
|
|
-dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
|
|
+dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
|
|
|
|
|
# 表达式级首选项
|
|
|
-dotnet_style_coalesce_expression = true:suggestion
|
|
|
-dotnet_style_collection_initializer = true:suggestion
|
|
|
-dotnet_style_explicit_tuple_names = true:suggestion
|
|
|
-dotnet_style_null_propagation = true:suggestion
|
|
|
-dotnet_style_object_initializer = true:suggestion
|
|
|
+dotnet_style_coalesce_expression = true
|
|
|
+dotnet_style_collection_initializer = true
|
|
|
+dotnet_style_explicit_tuple_names = true
|
|
|
+dotnet_style_null_propagation = true
|
|
|
+dotnet_style_object_initializer = true
|
|
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
|
|
dotnet_style_prefer_auto_properties = true:suggestion
|
|
|
-dotnet_style_prefer_compound_assignment = true:suggestion
|
|
|
-dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
|
|
-dotnet_style_prefer_conditional_expression_over_return = true:silent
|
|
|
-dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
|
|
-dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
|
|
-dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
|
|
-dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
|
|
-dotnet_style_prefer_simplified_interpolation = true:suggestion
|
|
|
+dotnet_style_prefer_compound_assignment = true
|
|
|
+dotnet_style_prefer_conditional_expression_over_assignment = true
|
|
|
+dotnet_style_prefer_conditional_expression_over_return = true
|
|
|
+dotnet_style_prefer_inferred_anonymous_type_member_names = true
|
|
|
+dotnet_style_prefer_inferred_tuple_names = true
|
|
|
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true
|
|
|
+dotnet_style_prefer_simplified_boolean_expressions = true
|
|
|
+dotnet_style_prefer_simplified_interpolation = true
|
|
|
|
|
|
# 字段首选项
|
|
|
-dotnet_style_readonly_field = true:suggestion
|
|
|
+dotnet_style_readonly_field = true
|
|
|
|
|
|
# 参数首选项
|
|
|
-dotnet_code_quality_unused_parameters = all:suggestion
|
|
|
+dotnet_code_quality_unused_parameters = all
|
|
|
+
|
|
|
+# 禁止显示首选项
|
|
|
+dotnet_remove_unnecessary_suppression_exclusions = none
|
|
|
|
|
|
#### c# 编码约定 ####
|
|
|
|
|
|
# var 首选项
|
|
|
-csharp_style_var_elsewhere = false:silent
|
|
|
-csharp_style_var_for_built_in_types = false:silent
|
|
|
-csharp_style_var_when_type_is_apparent = false:silent
|
|
|
+csharp_style_var_elsewhere = false
|
|
|
+csharp_style_var_for_built_in_types = false
|
|
|
+csharp_style_var_when_type_is_apparent = false
|
|
|
|
|
|
# Expression-bodied 成员
|
|
|
-csharp_style_expression_bodied_accessors = true:silent
|
|
|
-csharp_style_expression_bodied_constructors = false:silent
|
|
|
-csharp_style_expression_bodied_indexers = true:silent
|
|
|
-csharp_style_expression_bodied_lambdas = true:silent
|
|
|
-csharp_style_expression_bodied_local_functions = false:silent
|
|
|
-csharp_style_expression_bodied_methods = false:silent
|
|
|
-csharp_style_expression_bodied_operators = false:silent
|
|
|
-csharp_style_expression_bodied_properties = true:silent
|
|
|
+csharp_style_expression_bodied_accessors = true
|
|
|
+csharp_style_expression_bodied_constructors = false
|
|
|
+csharp_style_expression_bodied_indexers = true
|
|
|
+csharp_style_expression_bodied_lambdas = true
|
|
|
+csharp_style_expression_bodied_local_functions = false
|
|
|
+csharp_style_expression_bodied_methods = false
|
|
|
+csharp_style_expression_bodied_operators = false
|
|
|
+csharp_style_expression_bodied_properties = true
|
|
|
|
|
|
# 模式匹配首选项
|
|
|
-csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
|
|
-csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
|
|
-csharp_style_prefer_switch_expression = true:suggestion
|
|
|
+csharp_style_pattern_matching_over_as_with_null_check = true
|
|
|
+csharp_style_pattern_matching_over_is_with_cast_check = true
|
|
|
+csharp_style_prefer_not_pattern = true
|
|
|
+csharp_style_prefer_pattern_matching = true
|
|
|
+csharp_style_prefer_switch_expression = true
|
|
|
|
|
|
# Null 检查首选项
|
|
|
-csharp_style_conditional_delegate_call = true:suggestion
|
|
|
+csharp_style_conditional_delegate_call = true
|
|
|
|
|
|
# 修饰符首选项
|
|
|
-csharp_prefer_static_local_function = true:suggestion
|
|
|
-csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
|
|
|
+csharp_prefer_static_local_function = true
|
|
|
+csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
|
|
|
|
|
# 代码块首选项
|
|
|
-csharp_prefer_braces = true:silent
|
|
|
-csharp_prefer_simple_using_statement = false:suggestion
|
|
|
+csharp_prefer_braces = true
|
|
|
+csharp_prefer_simple_using_statement = false
|
|
|
|
|
|
# 表达式级首选项
|
|
|
-csharp_prefer_simple_default_expression = true:suggestion
|
|
|
-csharp_style_deconstructed_variable_declaration = true:suggestion
|
|
|
-csharp_style_inlined_variable_declaration = true:suggestion
|
|
|
-csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
|
|
-csharp_style_prefer_index_operator = true:suggestion
|
|
|
-csharp_style_prefer_range_operator = true:suggestion
|
|
|
-csharp_style_throw_expression = true:suggestion
|
|
|
-csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
|
|
-csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
|
|
+csharp_prefer_simple_default_expression = true
|
|
|
+csharp_style_deconstructed_variable_declaration = true
|
|
|
+csharp_style_implicit_object_creation_when_type_is_apparent = true
|
|
|
+csharp_style_inlined_variable_declaration = true
|
|
|
+csharp_style_pattern_local_over_anonymous_function = true
|
|
|
+csharp_style_prefer_index_operator = true
|
|
|
+csharp_style_prefer_range_operator = true
|
|
|
+csharp_style_throw_expression = true
|
|
|
+csharp_style_unused_value_assignment_preference = discard_variable
|
|
|
+csharp_style_unused_value_expression_statement_preference = discard_variable
|
|
|
|
|
|
# "using" 指令首选项
|
|
|
-csharp_using_directive_placement = outside_namespace:silent
|
|
|
+csharp_using_directive_placement = outside_namespace
|
|
|
|
|
|
#### C# 格式规则 ####
|
|
|
|
|
@@ -203,3 +209,13 @@ dotnet_naming_style.begins_with_i.required_prefix = I
|
|
|
dotnet_naming_style.begins_with_i.required_suffix =
|
|
|
dotnet_naming_style.begins_with_i.word_separator =
|
|
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
|
|
+
|
|
|
+# csproj 文件
|
|
|
+[*.csproj]
|
|
|
+charset = utf-8-bom
|
|
|
+indent_style = space
|
|
|
+indent_size = 4
|
|
|
+
|
|
|
+# sln 文件
|
|
|
+[*.sln]
|
|
|
+charset = utf-8-bom
|