root = true # 全部文件 [*] indent_style = space #指定缩进风格,可以是tab(制表符)或space(空格) # Xml files [*.xml] indent_size = 2 #定义一个缩进级别的大小。 [*.cs] end_of_line = lf #指定换行符的类型,可以是lf(Unix/Linux)、crlf(Windows)或cr(老式的Mac OS)。 indent_style = space #指定缩进风格,可以是tab(制表符)或space(空格) charset = utf-8 #设置文件字符集为utf-8,在 Linux 系统中,通常推荐使用 UTF-8 而不是 UTF-8 with BOM。添加 BOM 可能会干扰那些不期望在文件开头出现非 ASCII 字节的软件对 UTF-8 的使用。 trim_trailing_whitespace = true #指定是否删除行尾的空白字符。 insert_final_newline = true #指定文件末尾是否应该插入一个空白行。 indent_size = 4 # 模式匹配的偏好设置 csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion # 推荐使用模式匹配而非 is 与类型转换检查 csharp_style_pattern_matching_over_as_with_null_check = true:suggestion # 推荐使用模式匹配而非 as 与 null 检查 # 空检查的偏好设置 csharp_style_throw_expression = true:suggestion # 推荐使用 throw 表达式 csharp_style_conditional_delegate_call = true:suggestion # 推荐使用条件委托调用 # 修饰符的偏好设置 csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion # 修饰符的推荐顺序 # 表达式级别的偏好设置 csharp_prefer_braces = true:silent # 推荐使用大括号,即使在可能省略的情况下 csharp_style_deconstructed_variable_declaration = true:suggestion # 推荐使用解构变量声明 csharp_prefer_simple_default_expression = true:suggestion # 推荐使用简化的默认值表达式 csharp_style_prefer_local_over_anonymous_function = true:suggestion # 推荐使用本地函数而非匿名函数 csharp_style_inlined_variable_declaration = true:suggestion # 推荐内联变量声明 # 首选顶层语句的偏好设置 csharp_style_prefer_top_level_statements = true:silent # 推荐使用顶层语句,不强制要求