track/.editorconfig

77 lines
2.8 KiB
INI

# Top-most EditorConfig file
root = true
# All files
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
# C# files
[*.cs]
indent_style = space
indent_size = 4
# CS8618 表示在定义非空属性时,没有在构造函数、初始化器或默认值中对其进行初始化。
dotnet_diagnostic.cs8618.severity = none
# CS8618 表示方法的返回类型的可空性与目标委托的不匹配。
dotnet_diagnostic.cs8613.severity = none
# CS1591 表示缺少XML注释
dotnet_diagnostic.cs1591.severity = none
# 新行前的成员初始化
csharp_new_line_before_members_in_object_initializers = true
# 使用 var 关键字
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# 命名约定
dotnet_naming_rule.private_members_should_be_camel_case.severity = suggestion
dotnet_naming_rule.private_members_should_be_camel_case.symbols = private_members
dotnet_naming_rule.private_members_should_be_camel_case.style = camel_case
dotnet_naming_symbols.private_members.applicable_accessibilities = private
dotnet_naming_symbols.private_members.applicable_kinds = field
dotnet_naming_symbols.private_members.required_modifiers = readonly
dotnet_naming_style.camel_case.capitalization = camel_case
dotnet_naming_style.camel_case.required_prefix = _
dotnet_naming_style.camel_case.required_suffix =
# 空格和换行
csharp_space_after_cast = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_before_open_square_bracket = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_empty_method_call_parentheses = false
csharp_space_between_empty_method_declaration_parentheses = false
# 花括号
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
# 缩进规则
csharp_indent_case_contents = true
csharp_indent_block_contents = true
csharp_indent_braces = false
# 其他设置
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# resharper兼容
# 对象初始化收缩问题 https://youtrack.jetbrains.com/issue/RSRP-486359
resharper_wrap_object_and_collection_initializer_style = chop_always
# 条件表达式花括号收缩问题
resharper_csharp_case_block_braces = next_line_shifted_2
resharper_indent_braces_inside_statement_conditions = false