Skip to content

Commit c1f0aa9

Browse files
committed
添加项目文件。
0 parents  commit c1f0aa9

30 files changed

+2520
-0
lines changed

.editorconfig

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

.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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Nuget Package
2+
3+
on:
4+
release:
5+
types: [released,prereleased]
6+
branches: [ master ]
7+
8+
jobs:
9+
publish-with-build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Setup .NET Core SDK
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: '7.0.x'
19+
- name: restore dependencies
20+
run: dotnet restore
21+
- name: build
22+
run: dotnet build --no-restore -c Release
23+
- name: pack
24+
run: dotnet pack -c Release -o ./output --include-symbols
25+
- name: push package
26+
shell: pwsh
27+
working-directory: ./output
28+
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)