Skip to content

Commit 12ff8fd

Browse files
committed
Repo // Use dotnet built-in formatter instead.
1 parent 1e25ae7 commit 12ff8fd

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

.editorconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
root = true
2+
3+
[*.{cs}]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
tab_width = 2
10+
trim_trailing_whitespace = true
11+
12+
dotnet_diagnostic.CS8765.severity = none
13+
dotnet_diagnostic.CS8625.severity = none
14+
15+
# 括號樣式
16+
csharp_new_line_before_open_brace = none
17+
csharp_new_line_before_else = false
18+
csharp_new_line_before_catch = false
19+
csharp_new_line_before_finally = false
20+
csharp_new_line_before_members_in_object_initializers = false
21+
csharp_new_line_before_members_in_anonymous_types = false
22+
csharp_new_line_between_query_expression_clauses = false
23+
24+
# 空格規則
25+
csharp_space_after_cast = false
26+
csharp_space_after_keywords_in_control_flow_statements = true
27+
csharp_space_between_method_declaration_parameter_list_parentheses = false
28+
csharp_space_between_method_call_parameter_list_parentheses = false
29+
csharp_space_between_parentheses = false
30+
csharp_space_before_colon_in_inheritance_clause = true
31+
csharp_space_after_colon_in_inheritance_clause = true
32+
csharp_space_around_binary_operators = before_and_after
33+
csharp_space_before_colon_in_case_clause = false
34+
csharp_space_after_colon_in_case_clause = true
35+
csharp_space_between_empty_square_brackets = false
36+
csharp_space_between_square_brackets = false
37+
38+
# 排序 using 指令
39+
dotnet_sort_system_directives_first = true
40+
dotnet_separate_import_directive_groups = true
41+
42+
# 命名慣例
43+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
44+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
45+
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
46+
47+
dotnet_naming_symbols.private_fields.applicable_kinds = field
48+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
49+
50+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
51+
dotnet_naming_style.prefix_underscore.required_prefix = _
52+
53+
# 表達式風格
54+
csharp_prefer_braces = when_multiline:warning
55+
csharp_preserve_single_line_statements = true
56+
csharp_preserve_single_line_blocks = true
57+
58+
# 修飾詞順序
59+
dotnet_style_require_accessibility_modifiers = always:warning
60+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
61+
62+
# 註解處理
63+
csharp_style_documentation_for_line_comments = false:none
64+
csharp_style_documentation_for_headers = false:none
65+
66+
# 檔頭註解處理
67+
file_header_template = unset
68+
dotnet_diagnostic.IDE0073.severity = none
69+
70+
# XML 文件註解處理
71+
dotnet_diagnostic.CS1591.severity = none
72+
dotnet_diagnostic.CS1570.severity = none
73+
dotnet_diagnostic.CS1572.severity = none
74+
dotnet_diagnostic.CS1573.severity = none
75+
dotnet_diagnostic.IDE0076.severity = none
76+
dotnet_diagnostic.IDE0077.severity = none
77+
78+
# 忽略文件格式化
79+
dotnet_diagnostic.IDE0055.severity = none
80+
81+
# 忽略合併衝突標記
82+
dotnet_style_allow_multiple_blank_lines_experimental = false
83+
dotnet_style_allow_statement_immediately_after_block_experimental = false
84+
85+
# 補充排版規則
86+
csharp_indent_case_contents = true
87+
csharp_indent_switch_labels = true
88+
csharp_indent_block_contents = true
89+
csharp_indent_braces = false
90+
91+
# 補充對齊規則
92+
csharp_align_multiline_parameter = true
93+
csharp_align_multiline_argument = true
94+
csharp_align_multiline_calls_chain = true
95+
csharp_align_multiline_array_and_object_initializer = true

makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ all:
66
.PHONY: format pack
77

88
format:
9-
find . -regex '.*\.\(cs\)' -exec clang-format -style=file -i {} \;
9+
dotnet format
10+
# find . -regex '.*\.\(cs\)' -exec clang-format -style=file -i {} \;
1011
pack:
1112
dotnet build --configuration Release --no-restore ; dotnet test ; dotnet pack --configuration Release

0 commit comments

Comments
 (0)