Skip to content

Commit babb33e

Browse files
authored
Merge pull request #330 from dorthl/mian
Clean up the code and style it
2 parents 150b145 + a90fbc0 commit babb33e

File tree

240 files changed

+10662
-8261
lines changed

Some content is hidden

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

240 files changed

+10662
-8261
lines changed

.editorconfig

Lines changed: 182 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,51 @@
1-
# editorconfig.org
1+
# editorconfig.org
22
root = true
33

44
[*]
55
charset = utf-8
66
end_of_line = lf
77
indent_style = space
8-
indent_size = 4
8+
indent_size = 2
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
11+
dotnet_style_qualification_for_field = false:silent
12+
dotnet_style_qualification_for_property = false:silent
13+
dotnet_style_qualification_for_method = false:silent
14+
dotnet_style_qualification_for_event = false:silent
15+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
16+
tab_width = 2
17+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
18+
dotnet_code_quality_unused_parameters = all:suggestion
19+
dotnet_style_readonly_field = true:suggestion
20+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
21+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
22+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
23+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
24+
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
25+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
26+
dotnet_style_coalesce_expression = true:suggestion
27+
dotnet_style_null_propagation = true:suggestion
28+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
29+
dotnet_style_prefer_auto_properties = true:silent
30+
dotnet_style_object_initializer = true:suggestion
31+
dotnet_style_collection_initializer = true:suggestion
32+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
33+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
34+
dotnet_style_prefer_conditional_expression_over_return = true:silent
35+
dotnet_style_explicit_tuple_names = true:suggestion
36+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
37+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
38+
dotnet_style_prefer_compound_assignment = true:suggestion
39+
dotnet_style_prefer_simplified_interpolation = true:suggestion
40+
dotnet_style_namespace_match_folder = true:suggestion
41+
dotnet_style_predefined_type_for_member_access = true:silent
42+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
43+
44+
[*.{cshtml}]
45+
indent_size = 2
46+
47+
[*.{razor}]
48+
indent_size = 2
1149

1250
[*.{css,scss,js,json,yml}]
1351
indent_size = 2
@@ -20,3 +58,145 @@ trim_trailing_whitespace = false
2058

2159
[*.sln]
2260
indent_style = tab
61+
62+
[*.cs]
63+
#### 命名样式 ####
64+
65+
# 命名规则
66+
67+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
68+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
69+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
70+
71+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
72+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
73+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
74+
75+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
76+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
77+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
78+
79+
# 符号规范
80+
81+
dotnet_naming_symbols.interface.applicable_kinds = interface
82+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
83+
dotnet_naming_symbols.interface.required_modifiers =
84+
85+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
86+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
87+
dotnet_naming_symbols.types.required_modifiers =
88+
89+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
90+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
91+
dotnet_naming_symbols.non_field_members.required_modifiers =
92+
93+
# 命名样式
94+
95+
dotnet_naming_style.begins_with_i.required_prefix = I
96+
dotnet_naming_style.begins_with_i.required_suffix =
97+
dotnet_naming_style.begins_with_i.word_separator =
98+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
99+
100+
dotnet_naming_style.pascal_case.required_prefix =
101+
dotnet_naming_style.pascal_case.required_suffix =
102+
dotnet_naming_style.pascal_case.word_separator =
103+
dotnet_naming_style.pascal_case.capitalization = pascal_case
104+
105+
dotnet_naming_style.pascal_case.required_prefix =
106+
dotnet_naming_style.pascal_case.required_suffix =
107+
dotnet_naming_style.pascal_case.word_separator =
108+
dotnet_naming_style.pascal_case.capitalization = pascal_case
109+
csharp_using_directive_placement = outside_namespace:silent
110+
csharp_style_expression_bodied_methods = false:silent
111+
csharp_style_expression_bodied_constructors = false:silent
112+
csharp_style_expression_bodied_operators = false:silent
113+
csharp_style_expression_bodied_properties = true:silent
114+
csharp_style_expression_bodied_indexers = true:silent
115+
csharp_style_expression_bodied_accessors = true:silent
116+
csharp_style_expression_bodied_lambdas = true:silent
117+
csharp_style_expression_bodied_local_functions = false:silent
118+
csharp_style_conditional_delegate_call = true:suggestion
119+
csharp_style_var_for_built_in_types = false:silent
120+
csharp_style_var_when_type_is_apparent = false:silent
121+
csharp_style_var_elsewhere = false:silent
122+
csharp_prefer_simple_using_statement = true:suggestion
123+
csharp_prefer_braces = true:silent
124+
csharp_style_namespace_declarations = block_scoped:silent
125+
csharp_style_prefer_method_group_conversion = true:silent
126+
csharp_style_prefer_top_level_statements = true:silent
127+
csharp_prefer_static_local_function = true:suggestion
128+
csharp_style_prefer_readonly_struct = true:suggestion
129+
csharp_space_around_binary_operators = before_and_after
130+
csharp_indent_labels = one_less_than_current
131+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
132+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
133+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
134+
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
135+
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
136+
csharp_style_prefer_switch_expression = true:suggestion
137+
csharp_style_prefer_pattern_matching = true:silent
138+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
139+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
140+
csharp_style_prefer_not_pattern = true:suggestion
141+
csharp_style_prefer_extended_property_pattern = true:suggestion
142+
csharp_style_throw_expression = true:suggestion
143+
csharp_style_prefer_null_check_over_type_check = true:suggestion
144+
csharp_prefer_simple_default_expression = true:suggestion
145+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
146+
csharp_style_prefer_index_operator = true:suggestion
147+
csharp_style_prefer_range_operator = true:suggestion
148+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
149+
csharp_style_prefer_tuple_swap = true:suggestion
150+
csharp_style_prefer_utf8_string_literals = true:suggestion
151+
csharp_style_inlined_variable_declaration = true:suggestion
152+
csharp_style_deconstructed_variable_declaration = true:suggestion
153+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
154+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
155+
156+
[*.vb]
157+
#### 命名样式 ####
158+
159+
# 命名规则
160+
161+
dotnet_naming_rule.interface_should_be_以_i_开始.severity = suggestion
162+
dotnet_naming_rule.interface_should_be_以_i_开始.symbols = interface
163+
dotnet_naming_rule.interface_should_be_以_i_开始.style = 以_i_开始
164+
165+
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.severity = suggestion
166+
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.symbols = 类型
167+
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.style = 帕斯卡拼写法
168+
169+
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.severity = suggestion
170+
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.symbols = 非字段成员
171+
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.style = 帕斯卡拼写法
172+
173+
# 符号规范
174+
175+
dotnet_naming_symbols.interface.applicable_kinds = interface
176+
dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
177+
dotnet_naming_symbols.interface.required_modifiers =
178+
179+
dotnet_naming_symbols.类型.applicable_kinds = class, struct, interface, enum
180+
dotnet_naming_symbols.类型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
181+
dotnet_naming_symbols.类型.required_modifiers =
182+
183+
dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method
184+
dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
185+
dotnet_naming_symbols.非字段成员.required_modifiers =
186+
187+
# 命名样式
188+
189+
dotnet_naming_style.以_i_开始.required_prefix = I
190+
dotnet_naming_style.以_i_开始.required_suffix =
191+
dotnet_naming_style.以_i_开始.word_separator =
192+
dotnet_naming_style.以_i_开始.capitalization = pascal_case
193+
194+
dotnet_naming_style.帕斯卡拼写法.required_prefix =
195+
dotnet_naming_style.帕斯卡拼写法.required_suffix =
196+
dotnet_naming_style.帕斯卡拼写法.word_separator =
197+
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case
198+
199+
dotnet_naming_style.帕斯卡拼写法.required_prefix =
200+
dotnet_naming_style.帕斯卡拼写法.required_suffix =
201+
dotnet_naming_style.帕斯卡拼写法.word_separator =
202+
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,9 @@ MigrationBackup/
350350
.ionide/
351351

352352
.DS_Store
353+
Blog.db-shm
354+
Blog.db-wal
355+
356+
App_Data/
357+
358+
appsettings.Development.json

.vscode/launch.json

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
{
2-
// Use IntelliSense to find out which attributes exist for C# debugging
3-
// Use hover for the description of the existing attributes
4-
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "Launch and Debug Blazor WebAssembly App",
9-
"type": "coreclr",
10-
"request": "launch",
11-
"program": "dotnet",
12-
"args":["run"],
13-
"cwd": "${workspaceFolder}/src/Blogifier",
14-
"env": { "ASPNETCORE_ENVIRONMENT": "Development" },
15-
"launchBrowser": {
16-
"enabled": true,
17-
"args": "${auto-detect-url}",
18-
"windows": {
19-
"command": "cmd.exe",
20-
"args": "/C start ${auto-detect-url}",
21-
},
22-
"osx": {
23-
"command": "open"
24-
},
25-
"linux": {
26-
"command": "xdg-open"
27-
}
28-
}
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch and Debug Blazor WebAssembly App",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"program": "dotnet",
12+
"args": [
13+
"watch"
14+
],
15+
"cwd": "${workspaceFolder}/src/Blogifier",
16+
"env": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
},
19+
"launchBrowser": {
20+
"enabled": true,
21+
"args": "${auto-detect-url}",
22+
"windows": {
23+
"command": "cmd.exe",
24+
"args": "/C start ${auto-detect-url}",
25+
},
26+
"osx": {
27+
"command": "open"
28+
},
29+
"linux": {
30+
"command": "xdg-open"
2931
}
30-
]
31-
}
32+
}
33+
}
34+
]
35+
}

.vscode/tasks.json

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"label": "build",
6-
"command": "dotnet",
7-
"type": "process",
8-
"args": [
9-
"build",
10-
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
11-
"/property:GenerateFullPaths=true",
12-
"/consoleloggerparameters:NoSummary"
13-
],
14-
"problemMatcher": "$msCompile"
15-
},
16-
{
17-
"label": "publish",
18-
"command": "dotnet",
19-
"type": "process",
20-
"args": [
21-
"publish",
22-
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
23-
"/property:GenerateFullPaths=true",
24-
"/consoleloggerparameters:NoSummary"
25-
],
26-
"problemMatcher": "$msCompile"
27-
},
28-
{
29-
"label": "watch",
30-
"command": "dotnet",
31-
"type": "process",
32-
"args": [
33-
"watch",
34-
"run",
35-
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
36-
"/property:GenerateFullPaths=true",
37-
"/consoleloggerparameters:NoSummary"
38-
],
39-
"problemMatcher": "$msCompile"
40-
}
41-
]
42-
}
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/src/Blogifier/Blogifier.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)