Vehicle_Road_Counter/.editorconfig

51 lines
1.8 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

root = true
# --- 全局设置 ---
[*]
charset = utf-8
indent_style = tab
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100
# --- C# 专属设置 (关键) ---
[*.cs]
# 1. 缩进:强制 Tab
indent_style = tab
# 2. 大括号风格K&B (Open brace on same line)
# 这是一个“叛逆”的设置,因为 C# 默认是换行的
csharp_new_line_before_open_brace = none
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
# 3. 命名规范检查 (适配您的 UserDetail / GetUser / userName)
# 说明EditorConfig 可以配置 Roslyn 分析器来检查命名
# 类 (Class) -> PascalCase (UserDetail)
dotnet_naming_rule.classes_must_be_pascal_case.severity = warning
dotnet_naming_rule.classes_must_be_pascal_case.symbols = classes
dotnet_naming_rule.classes_must_be_pascal_case.style = pascal_case
dotnet_naming_symbols.classes.applicable_kinds = class, struct, enum, interface
dotnet_naming_style.pascal_case.capitalization = pascal_case
# 方法 (Method) -> PascalCase (GetUser)
dotnet_naming_rule.methods_must_be_pascal_case.severity = warning
dotnet_naming_rule.methods_must_be_pascal_case.symbols = methods
dotnet_naming_rule.methods_must_be_pascal_case.style = pascal_case
dotnet_naming_symbols.methods.applicable_kinds = method
# 局部变量/参数 (Function Name/Local) -> camelCase (userName)
dotnet_naming_rule.locals_must_be_camel_case.severity = warning
dotnet_naming_rule.locals_must_be_camel_case.symbols = locals
dotnet_naming_rule.locals_must_be_camel_case.style = camel_case
dotnet_naming_symbols.locals.applicable_kinds = local, parameter
dotnet_naming_style.camel_case.capitalization = camel_case