Skip to content

Commit

Permalink
Repo // Use dotnet built-in formatter instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen committed Feb 13, 2025
1 parent 9198bf4 commit e49f21d
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 5 deletions.
94 changes: 93 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
[*.cs]
root = true

[*.{cs}]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true

dotnet_diagnostic.CS8765.severity = none
dotnet_diagnostic.CS8625.severity = none

# 括號樣式
csharp_new_line_before_open_brace = none
csharp_new_line_before_else = false
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false

# 空格規則
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_colon_in_case_clause = false
csharp_space_after_colon_in_case_clause = true
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false

# 排序 using 指令
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true

# 命名慣例
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
dotnet_naming_rule.private_members_with_underscore.severity = suggestion

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_style.prefix_underscore.capitalization = camel_case
dotnet_naming_style.prefix_underscore.required_prefix = _

# 表達式風格
csharp_prefer_braces = true:warning

# 修飾詞順序
dotnet_style_require_accessibility_modifiers = always:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning

# 註解處理
csharp_style_documentation_for_line_comments = false:none
csharp_style_documentation_for_headers = false:none

# 檔頭註解處理
file_header_template = unset
dotnet_diagnostic.IDE0073.severity = none

# XML 文件註解處理
dotnet_diagnostic.CS1591.severity = none
dotnet_diagnostic.CS1570.severity = none
dotnet_diagnostic.CS1572.severity = none
dotnet_diagnostic.CS1573.severity = none
dotnet_diagnostic.IDE0076.severity = none
dotnet_diagnostic.IDE0077.severity = none

# 忽略文件格式化
dotnet_diagnostic.IDE0055.severity = none
dotnet_diagnostic.IDE0073.severity = none

# 忽略合併衝突標記
dotnet_style_allow_multiple_blank_lines_experimental = false
dotnet_style_allow_statement_immediately_after_block_experimental = false

# 補充排版規則
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_block_contents = true
csharp_indent_braces = false

# 補充換行規則
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false

# 補充對齊規則
csharp_align_multiline_parameter = true
csharp_align_multiline_argument = true
csharp_align_multiline_calls_chain = true
csharp_align_multiline_array_and_object_initializer = true
9 changes: 5 additions & 4 deletions Megrez.Tests/Megrez.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Nullable>enable</Nullable>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<ReleaseVersion>3.0.0</ReleaseVersion>
<TargetFrameworks>net6.0</TargetFrameworks>
Expand All @@ -11,9 +11,10 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down

0 comments on commit e49f21d

Please sign in to comment.