root = true
# EditorConfig is awesome: https://EditorConfig.org
# Please feel free to update it (by considering the code style of ABP Team).
# top-most EditorConfig file

[*]
charset = utf-8
end_of_line = crlf
trim_trailing_whitespace = false
insert_final_newline = false
indent_style = space
indent_size = 4
tab_width = 4

[*.json]
indent_size = 2

[*.cs]
# diagnostic规则配置 各个项目自己定义
# CS8618 表示在定义非空属性时，没有在构造函数、初始化器或默认值中对其进行初始化。
dotnet_diagnostic.cs8618.severity = none
# CS8618 表示方法的返回类型的可空性与目标委托的不匹配。
dotnet_diagnostic.cs8613.severity = none
# CS1591 表示缺少XML注释
dotnet_diagnostic.cs1591.severity = none

#Namespace设置
csharp_style_namespace_declarations = file_scoped:silent

# 设置每行的最大列数
max_line_length = 120
#缩进switch case内容
csharp_indent_case_contents = true
#缩进switch标签
csharp_indent_switch_labels = true

#Formatting - new line options

#在新行上放置catch语句
csharp_new_line_before_catch = true
#在新行上放置else语句
csharp_new_line_before_else = true
#要求对象初始化器的成员在单独的行上
csharp_new_line_before_members_in_object_initializers = true
#要求在对象集合数组初始化器、方法、控制块、类型和lambda表达式的花括号前换行（也称为“Allman”风格）
csharp_new_line_before_open_brace = object_collection_array_initializers, methods, control_blocks, types, lambdas

#Formatting - organize using options

#按字母顺序排序System.*using指令，并将它们放在其他using指令之前
dotnet_sort_system_directives_first = true

#Formatting - spacing options

#要求在类型转换和值之间不留空格
csharp_space_after_cast = false
#在类型声明中要求在基类或接口的冒号前留空格
csharp_space_after_colon_in_inheritance_clause = true
#在控制流语句（如for循环）中的关键字后要求留空格
csharp_space_after_keywords_in_control_flow_statements = true
#在类型声明中要求在基类或接口的冒号前留空格
csharp_space_before_colon_in_inheritance_clause = true
#删除空参数列表括号内的空格
csharp_space_between_method_call_empty_parameter_list_parentheses = false
#删除方法调用名称和左括号之间的空格
csharp_space_between_method_call_name_and_opening_parenthesis = false
#在方法调用的左括号后和右括号前不要留空格
csharp_space_between_method_call_parameter_list_parentheses = false
#删除方法声明中空参数列表括号内的空格
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
#在方法声明参数列表的左括号后和右括号前留空格
csharp_space_between_method_declaration_parameter_list_parentheses = false

#Formatting - wrapping options

#将代码块留在单行上
csharp_preserve_single_line_blocks = true

#Style - Code block preferences

#即使是单行代码也使用花括号
csharp_prefer_braces = true:suggestion

#Style - expression bodied member options

#构造函数使用块体
csharp_style_expression_bodied_constructors = false:suggestion
#方法使用块体
csharp_style_expression_bodied_methods = false:suggestion
#属性使用表达式体
csharp_style_expression_bodied_properties = true:suggestion

#Style - expression level options

#尽可能在方法调用的参数列表中内联声明out变量
csharp_style_inlined_variable_declaration = true:suggestion
#对于有关键字表示的类型，成员访问表达式使用语言关键字而不是类型名
dotnet_style_predefined_type_for_member_access = true:suggestion

#Style - Expression-level preferences

#使用default而不是default(T)
csharp_prefer_simple_default_expression = true:suggestion
#尽可能使用对象初始化器初始化对象
dotnet_style_object_initializer = true:suggestion
#使用推断的元组元素名称
dotnet_style_prefer_inferred_tuple_names = true:suggestion

#Style - implicit and explicit types

#在所有情况下都使用var代替显式类型，除非被其他代码样式规则覆盖
csharp_style_var_elsewhere = true:suggestion
#使用var声明内置系统类型（如int）的变量
csharp_style_var_for_built_in_types = true:suggestion
#当类型已经在声明表达式的右侧提及时，使用var
csharp_style_var_when_type_is_apparent = true:suggestion

#Style - language keyword and framework type options

#对于有关键字表示的类型，局部变量、方法参数和类成员使用语言关键字而不是类型名
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

#Style - Miscellaneous preferences

#使用局部函数而不是匿名函数
csharp_style_pattern_local_over_anonymous_function = true:suggestion

#Style - modifier options

#除了公共接口成员外，偏好声明访问修饰符。这目前不会与“总是”不同，并且将在C#添加默认接口方法时作为未来的保护措施。
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

#Style - Modifier preferences

#当此规则设置为修饰符列表时，偏好指定的顺序。
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion

#Style - Pattern matching

#使用模式匹配而不是带有类型转换的is表达式
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion

#Style - qualification options

#偏好字段前不加this. 或 Me.（在Visual Basic中）
dotnet_style_qualification_for_field = false:suggestion
#偏好方法前不加this. 或 Me.（在Visual Basic中）
dotnet_style_qualification_for_method = false:suggestion
#偏好属性前不加this. 或 Me.（在Visual Basic中）
dotnet_style_qualification_for_property = false:suggestion

# Microsoft .NET properties
csharp_style_prefer_utf8_string_literals = true:suggestion
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
dotnet_style_qualification_for_event = false:suggestion

# ReSharper properties
resharper_autodetect_indent_settings = true
resharper_braces_for_for = not_required
resharper_braces_for_foreach = not_required
resharper_braces_for_ifelse = not_required_for_both
resharper_braces_for_while = not_required
resharper_braces_redundant = true
resharper_csharp_keep_existing_enum_arrangement = false
resharper_formatter_off_tag = @formatter:off
resharper_formatter_on_tag = @formatter:on
resharper_formatter_tags_enabled = true
resharper_keep_existing_declaration_block_arrangement = false
resharper_keep_existing_embedded_block_arrangement = false
resharper_use_heuristics_for_body_style = true
resharper_use_indent_from_vs = false

# ReSharper inspection severities
resharper_arrange_accessor_owner_body_highlighting = suggestion
resharper_arrange_constructor_or_destructor_body_highlighting = none
resharper_arrange_method_or_operator_body_highlighting = none
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_arrange_type_member_modifiers_highlighting = hint
resharper_arrange_type_modifiers_highlighting = hint
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
resharper_built_in_type_reference_style_highlighting = hint
resharper_enforce_do_while_statement_braces_highlighting = none
resharper_enforce_fixed_statement_braces_highlighting = none
resharper_enforce_foreach_statement_braces_highlighting = none
resharper_enforce_for_statement_braces_highlighting = none
resharper_enforce_if_statement_braces_highlighting = none
resharper_enforce_lock_statement_braces_highlighting = none
resharper_enforce_using_statement_braces_highlighting = none
resharper_enforce_while_statement_braces_highlighting = none
resharper_mvc_action_not_resolved_highlighting = warning
resharper_mvc_area_not_resolved_highlighting = warning
resharper_mvc_controller_not_resolved_highlighting = warning
resharper_mvc_masterpage_not_resolved_highlighting = warning
resharper_mvc_partial_view_not_resolved_highlighting = warning
resharper_mvc_template_not_resolved_highlighting = warning
resharper_mvc_view_component_not_resolved_highlighting = warning
resharper_mvc_view_component_view_not_resolved_highlighting = warning
resharper_mvc_view_not_resolved_highlighting = warning
resharper_razor_assembly_not_resolved_highlighting = warning
resharper_redundant_base_qualifier_highlighting = warning
resharper_remove_redundant_braces_highlighting = none
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = hint
resharper_suggest_var_or_type_simple_types_highlighting = hint
resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after