Skip to content

Commit 6ec8e56

Browse files
committed
feat: 添加项目文件
0 parents  commit 6ec8e56

File tree

102 files changed

+5758
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5758
-0
lines changed

.editorconfig

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
# 如果要从更高级别的目录继承 .editorconfig 设置,请删除以下行
2+
root = true
3+
4+
[*]
5+
charset = utf-8-bom
6+
end_of_line = crlf
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_size = 2
11+
tab_width = 2
12+
13+
# c# 文件
14+
[*.cs]
15+
16+
#### Core EditorConfig 选项 ####
17+
18+
# 缩进和间距
19+
indent_size = 4
20+
tab_width = 4
21+
22+
#### .NET 编码约定 ####
23+
24+
# 组织 Using
25+
dotnet_separate_import_directive_groups = false
26+
dotnet_sort_system_directives_first = true
27+
file_header_template = unset
28+
29+
# this. 和 Me. 首选项
30+
dotnet_style_qualification_for_event = false
31+
dotnet_style_qualification_for_field = false
32+
dotnet_style_qualification_for_method = false
33+
dotnet_style_qualification_for_property = false
34+
35+
# 语言关键字与 bcl 类型首选项
36+
dotnet_style_predefined_type_for_locals_parameters_members = true
37+
dotnet_style_predefined_type_for_member_access = true
38+
39+
# 括号首选项
40+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
41+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
42+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
43+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
44+
45+
# 修饰符首选项
46+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
47+
48+
# 表达式级首选项
49+
dotnet_style_coalesce_expression = true
50+
dotnet_style_collection_initializer = true
51+
dotnet_style_explicit_tuple_names = true
52+
dotnet_style_namespace_match_folder = true
53+
dotnet_style_null_propagation = true
54+
dotnet_style_object_initializer = true
55+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
56+
dotnet_style_prefer_auto_properties = true
57+
dotnet_style_prefer_compound_assignment = true
58+
dotnet_style_prefer_conditional_expression_over_assignment = true
59+
dotnet_style_prefer_conditional_expression_over_return = true
60+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
61+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
62+
dotnet_style_prefer_inferred_tuple_names = true
63+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
64+
dotnet_style_prefer_simplified_boolean_expressions = true
65+
dotnet_style_prefer_simplified_interpolation = true
66+
67+
# 字段首选项
68+
dotnet_style_readonly_field = true
69+
70+
# 参数首选项
71+
dotnet_code_quality_unused_parameters = all
72+
73+
# 禁止显示首选项
74+
dotnet_remove_unnecessary_suppression_exclusions = 0
75+
76+
# 新行首选项
77+
dotnet_style_allow_multiple_blank_lines_experimental = true
78+
dotnet_style_allow_statement_immediately_after_block_experimental = true
79+
80+
#### c# 编码约定 ####
81+
82+
# var 首选项
83+
csharp_style_var_elsewhere = false:silent
84+
csharp_style_var_for_built_in_types = false:silent
85+
csharp_style_var_when_type_is_apparent = false:silent
86+
87+
# Expression-bodied 成员
88+
csharp_style_expression_bodied_accessors = true:silent
89+
csharp_style_expression_bodied_constructors = false:silent
90+
csharp_style_expression_bodied_indexers = true:silent
91+
csharp_style_expression_bodied_lambdas = true:silent
92+
csharp_style_expression_bodied_local_functions = false:silent
93+
csharp_style_expression_bodied_methods = false:silent
94+
csharp_style_expression_bodied_operators = false:silent
95+
csharp_style_expression_bodied_properties = true:silent
96+
97+
# 模式匹配首选项
98+
csharp_style_pattern_matching_over_as_with_null_check = true
99+
csharp_style_pattern_matching_over_is_with_cast_check = true
100+
csharp_style_prefer_extended_property_pattern = true
101+
csharp_style_prefer_not_pattern = true
102+
csharp_style_prefer_pattern_matching = true
103+
csharp_style_prefer_switch_expression = true
104+
105+
# Null 检查首选项
106+
csharp_style_conditional_delegate_call = true:suggestion
107+
108+
# 修饰符首选项
109+
csharp_prefer_static_local_function = true:suggestion
110+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
111+
csharp_style_prefer_readonly_struct = true
112+
113+
# 代码块首选项
114+
csharp_prefer_braces = true:silent
115+
csharp_prefer_simple_using_statement = true:suggestion
116+
csharp_prefer_system_threading_lock = true:suggestion
117+
csharp_style_namespace_declarations = file_scoped:suggestion
118+
csharp_style_prefer_method_group_conversion = true:silent
119+
csharp_style_prefer_top_level_statements = true:silent
120+
121+
# 表达式级首选项
122+
csharp_prefer_simple_default_expression = true
123+
csharp_style_deconstructed_variable_declaration = true
124+
csharp_style_implicit_object_creation_when_type_is_apparent = true
125+
csharp_style_inlined_variable_declaration = true
126+
csharp_style_prefer_index_operator = true
127+
csharp_style_prefer_local_over_anonymous_function = true
128+
csharp_style_prefer_null_check_over_type_check = true
129+
csharp_style_prefer_range_operator = true
130+
csharp_style_prefer_tuple_swap = true
131+
csharp_style_prefer_utf8_string_literals = true
132+
csharp_style_prefer_primary_constructors = true:suggestion
133+
csharp_style_throw_expression = true
134+
csharp_style_unused_value_assignment_preference = discard_variable
135+
csharp_style_unused_value_expression_statement_preference = discard_variable
136+
137+
# "using" 指令首选项
138+
csharp_using_directive_placement = outside_namespace:silent
139+
140+
# 新行首选项
141+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
142+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
143+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
144+
145+
#### C# 格式规则 ####
146+
147+
# 新行首选项
148+
csharp_new_line_before_catch = true
149+
csharp_new_line_before_else = true
150+
csharp_new_line_before_finally = true
151+
csharp_new_line_before_members_in_anonymous_types = true
152+
csharp_new_line_before_members_in_object_initializers = true
153+
csharp_new_line_before_open_brace = all
154+
csharp_new_line_between_query_expression_clauses = true
155+
156+
# 缩进首选项
157+
csharp_indent_block_contents = true
158+
csharp_indent_braces = false
159+
csharp_indent_case_contents = true
160+
csharp_indent_case_contents_when_block = true
161+
csharp_indent_labels = one_less_than_current
162+
csharp_indent_switch_labels = true
163+
164+
# 空格键首选项
165+
csharp_space_after_cast = false
166+
csharp_space_after_colon_in_inheritance_clause = true
167+
csharp_space_after_comma = true
168+
csharp_space_after_dot = false
169+
csharp_space_after_keywords_in_control_flow_statements = true
170+
csharp_space_after_semicolon_in_for_statement = true
171+
csharp_space_around_binary_operators = before_and_after
172+
csharp_space_around_declaration_statements = false
173+
csharp_space_before_colon_in_inheritance_clause = true
174+
csharp_space_before_comma = false
175+
csharp_space_before_dot = false
176+
csharp_space_before_open_square_brackets = false
177+
csharp_space_before_semicolon_in_for_statement = false
178+
csharp_space_between_empty_square_brackets = false
179+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
180+
csharp_space_between_method_call_name_and_opening_parenthesis = false
181+
csharp_space_between_method_call_parameter_list_parentheses = false
182+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
183+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
184+
csharp_space_between_method_declaration_parameter_list_parentheses = false
185+
csharp_space_between_parentheses = false
186+
csharp_space_between_square_brackets = false
187+
188+
# 包装首选项
189+
csharp_preserve_single_line_blocks = true
190+
csharp_preserve_single_line_statements = true
191+
192+
#### 命名样式 ####
193+
194+
# 命名规则
195+
196+
dotnet_naming_rule.接口_should_be_以i开头.severity = warning
197+
dotnet_naming_rule.接口_should_be_以i开头.symbols = 接口
198+
dotnet_naming_rule.接口_should_be_以i开头.style = 以i开头
199+
200+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.severity = warning
201+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.symbols = 类型_接口_类_枚举_结构体_
202+
dotnet_naming_rule.类型_接口_类_枚举_结构体__should_be_pascal_case.style = pascal_case
203+
204+
dotnet_naming_rule.非字段成员_should_be_pascal_case.severity = warning
205+
dotnet_naming_rule.非字段成员_should_be_pascal_case.symbols = 非字段成员
206+
dotnet_naming_rule.非字段成员_should_be_pascal_case.style = pascal_case
207+
208+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.severity = warning
209+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.symbols = 私有静态只读字段
210+
dotnet_naming_rule.私有静态只读字段_should_be_以s_为前缀.style = 以s_为前缀
211+
212+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.severity = warning
213+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.symbols = 公有静态只读字段
214+
dotnet_naming_rule.公有静态只读字段_should_be_pascal_case.style = pascal_case
215+
216+
dotnet_naming_rule.常量_should_be_pascal_case.severity = warning
217+
dotnet_naming_rule.常量_should_be_pascal_case.symbols = 常量
218+
dotnet_naming_rule.常量_should_be_pascal_case.style = pascal_case
219+
220+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.severity = warning
221+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.symbols = 静态字段
222+
dotnet_naming_rule.静态字段_should_be_以s_为前缀.style = 以s_为前缀
223+
224+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.severity = warning
225+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.symbols = 私有或内部字段
226+
dotnet_naming_rule.私有或内部字段_should_be_以_为前缀.style = 以_为前缀
227+
228+
dotnet_naming_rule.属性_should_be_pascal_case.severity = warning
229+
dotnet_naming_rule.属性_should_be_pascal_case.symbols = 属性
230+
dotnet_naming_rule.属性_should_be_pascal_case.style = pascal_case
231+
232+
dotnet_naming_rule.方法_should_be_pascal_case.severity = warning
233+
dotnet_naming_rule.方法_should_be_pascal_case.symbols = 方法
234+
dotnet_naming_rule.方法_should_be_pascal_case.style = pascal_case
235+
236+
# 符号规范
237+
238+
dotnet_naming_symbols.接口.applicable_kinds = interface
239+
dotnet_naming_symbols.接口.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
240+
dotnet_naming_symbols.接口.required_modifiers =
241+
242+
dotnet_naming_symbols.方法.applicable_kinds = method
243+
dotnet_naming_symbols.方法.applicable_accessibilities = *
244+
dotnet_naming_symbols.方法.required_modifiers =
245+
246+
dotnet_naming_symbols.属性.applicable_kinds = property
247+
dotnet_naming_symbols.属性.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
248+
dotnet_naming_symbols.属性.required_modifiers =
249+
250+
dotnet_naming_symbols.静态字段.applicable_kinds = field
251+
dotnet_naming_symbols.静态字段.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
252+
dotnet_naming_symbols.静态字段.required_modifiers = static
253+
254+
dotnet_naming_symbols.私有或内部字段.applicable_kinds = field
255+
dotnet_naming_symbols.私有或内部字段.applicable_accessibilities = internal, private, private_protected
256+
dotnet_naming_symbols.私有或内部字段.required_modifiers =
257+
258+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.applicable_kinds = class, struct, interface, enum
259+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
260+
dotnet_naming_symbols.类型_接口_类_枚举_结构体_.required_modifiers =
261+
262+
dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method
263+
dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
264+
dotnet_naming_symbols.非字段成员.required_modifiers =
265+
266+
dotnet_naming_symbols.常量.applicable_kinds = field
267+
dotnet_naming_symbols.常量.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
268+
dotnet_naming_symbols.常量.required_modifiers = const
269+
270+
dotnet_naming_symbols.私有静态只读字段.applicable_kinds = field
271+
dotnet_naming_symbols.私有静态只读字段.applicable_accessibilities = private, protected, protected_internal, private_protected
272+
dotnet_naming_symbols.私有静态只读字段.required_modifiers = readonly, static
273+
274+
dotnet_naming_symbols.公有静态只读字段.applicable_kinds = field
275+
dotnet_naming_symbols.公有静态只读字段.applicable_accessibilities = public, internal
276+
dotnet_naming_symbols.公有静态只读字段.required_modifiers = readonly, static
277+
278+
# 命名样式
279+
280+
dotnet_naming_style.pascal_case.required_prefix =
281+
dotnet_naming_style.pascal_case.required_suffix =
282+
dotnet_naming_style.pascal_case.word_separator =
283+
dotnet_naming_style.pascal_case.capitalization = pascal_case
284+
285+
dotnet_naming_style.以i开头.required_prefix = I
286+
dotnet_naming_style.以i开头.required_suffix =
287+
dotnet_naming_style.以i开头.word_separator =
288+
dotnet_naming_style.以i开头.capitalization = pascal_case
289+
290+
dotnet_naming_style.以s_为前缀.required_prefix = s_
291+
dotnet_naming_style.以s_为前缀.required_suffix =
292+
dotnet_naming_style.以s_为前缀.word_separator =
293+
dotnet_naming_style.以s_为前缀.capitalization = camel_case
294+
295+
dotnet_naming_style.以_为前缀.required_prefix = _
296+
dotnet_naming_style.以_为前缀.required_suffix =
297+
dotnet_naming_style.以_为前缀.word_separator =
298+
dotnet_naming_style.以_为前缀.capitalization = camel_case

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish Nuget Package
2+
3+
on:
4+
release:
5+
types: [ released, prereleased ]
6+
branches: [ main ]
7+
8+
jobs:
9+
publish-with-build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup .NET Core SDK
14+
uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: |
17+
8.x
18+
9.x
19+
- name: restore dependencies
20+
run: dotnet restore
21+
- name: build
22+
run: dotnet build --no-restore -c Release
23+
- name: test
24+
run: dotnet test --no-restore -c Release
25+
- name: pack
26+
run: dotnet pack -c Release -o ./output
27+
- name: push package
28+
shell: pwsh
29+
working-directory: ./output
30+
run: Get-ChildItem -File -Filter '*.nupkg' | ForEach-Object { dotnet nuget push $_ -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --no-service-endpoint --skip-duplicate; dotnet nuget push $_ -k ${{secrets.NUGET_GITHUB_KEY}} -s https://nuget.pkg.github.com/stratosblue/index.json --no-service-endpoint --skip-duplicate; }

0 commit comments

Comments
 (0)