Skip to content

Commit 63c8366

Browse files
committed
最后的重构
1 parent f01fd36 commit 63c8366

File tree

294 files changed

+19671
-20087
lines changed

Some content is hidden

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

294 files changed

+19671
-20087
lines changed

.editorconfig

+80-197
Original file line numberDiff line numberDiff line change
@@ -1,257 +1,140 @@
1-
# Schema: http://EditorConfig.org
2-
# Docs: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
3-
4-
# top-most EditorConfig file
1+
###############################
2+
# Core EditorConfig Options #
3+
###############################
54
root = true
6-
7-
# Don't use tabs for indentation.
5+
# All files
86
[*]
97
indent_style = space
10-
trim_trailing_whitespace = true
11-
12-
# Code files
13-
[*.{cs,csx,vb,vbx}]
14-
indent_size = 4
15-
indent_style = tab
16-
insert_final_newline = true
17-
#charset = utf-8-bom
188

19-
# Xml project files
9+
# XML project files
2010
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
2111
indent_size = 2
2212

23-
# Xml config files
24-
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,xml,stylecop}]
25-
indent_size = 2
26-
27-
# JSON files
28-
[*.json]
29-
indent_size = 2
30-
31-
# Powershell files
32-
[*.ps1]
33-
indent_size = 2
34-
35-
# Shell scripts
36-
[*.sh]
37-
end_of_line = lf
38-
indent_size = 2
39-
40-
[*.{cmd,bat}]
41-
end_of_line = crlf
13+
# XML config files
14+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
4215
indent_size = 2
4316

44-
## Language conventions
45-
# Dotnet code style settings:
17+
# Code files
18+
[*.{cs,csx,vb,vbx}]
19+
indent_size = 4
20+
insert_final_newline = true
21+
charset = utf-8
22+
trim_trailing_whitespace = true
23+
###############################
24+
# .NET Coding Conventions #
25+
###############################
4626
[*.{cs,vb}]
47-
# "This." and "Me." qualifiers
27+
# Organize usings
28+
dotnet_sort_system_directives_first = true
29+
# this. preferences
4830
dotnet_style_qualification_for_field = false:suggestion
4931
dotnet_style_qualification_for_property = false:suggestion
50-
dotnet_style_qualification_for_method = false:suggestion
51-
dotnet_style_qualification_for_event = false:suggestion
52-
53-
# Language keywords instead of framework type names for type references
32+
dotnet_style_qualification_for_method = false:silent
33+
dotnet_style_qualification_for_event = false:silent
34+
# Language keywords vs BCL types preferences
5435
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
5536
dotnet_style_predefined_type_for_member_access = true:suggestion
56-
57-
# Modifier preferences
58-
dotnet_style_require_accessibility_modifiers = always:suggestion
59-
dotnet_style_readonly_field = true:warning
60-
6137
# Parentheses preferences
6238
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
6339
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
6440
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
6541
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
66-
42+
# Modifier preferences
43+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
44+
dotnet_style_readonly_field = true:suggestion
6745
# Expression-level preferences
6846
dotnet_style_object_initializer = true:suggestion
6947
dotnet_style_collection_initializer = true:suggestion
7048
dotnet_style_explicit_tuple_names = true:suggestion
49+
dotnet_style_null_propagation = true:suggestion
50+
dotnet_style_coalesce_expression = true:suggestion
51+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
7152
dotnet_style_prefer_inferred_tuple_names = true:suggestion
7253
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
7354
dotnet_style_prefer_auto_properties = true:silent
74-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
75-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
76-
77-
# Null-checking preferences
78-
dotnet_style_coalesce_expression = true:suggestion
79-
dotnet_style_null_propagation = true:suggestion
80-
81-
# CSharp code style settings:
55+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
56+
dotnet_style_prefer_conditional_expression_over_return = true:silent
57+
###############################
58+
# Naming Conventions #
59+
###############################
60+
# Style Definitions
61+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
62+
# Use PascalCase for constant fields
63+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
64+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
65+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
66+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
67+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
68+
dotnet_naming_symbols.constant_fields.required_modifiers = const
69+
###############################
70+
# C# Coding Conventions #
71+
###############################
8272
[*.cs]
83-
# Modifier preferences
84-
csharp_preferred_modifier_order = public,private,protected,internal,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
85-
86-
# Implicit and explicit types
73+
# var preferences
8774
csharp_style_var_for_built_in_types = true:suggestion
8875
csharp_style_var_when_type_is_apparent = true:suggestion
8976
csharp_style_var_elsewhere = true:suggestion
90-
9177
# Expression-bodied members
92-
# Explicitly disabled due to difference in coding style between source and tests
93-
#csharp_style_expression_bodied_methods = false:silent
94-
#csharp_style_expression_bodied_constructors = false:silent
78+
csharp_style_expression_bodied_methods = false:silent
79+
csharp_style_expression_bodied_constructors = false:silent
9580
csharp_style_expression_bodied_operators = false:silent
96-
csharp_style_expression_bodied_properties = true:suggestion
97-
csharp_style_expression_bodied_indexers = true:suggestion
98-
csharp_style_expression_bodied_accessors = true:suggestion
99-
100-
# Pattern matching
81+
csharp_style_expression_bodied_properties = true:silent
82+
csharp_style_expression_bodied_indexers = true:silent
83+
csharp_style_expression_bodied_accessors = true:silent
84+
# Pattern matching preferences
10185
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
10286
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
103-
104-
# Inlined variable declarations
105-
csharp_style_inlined_variable_declaration = true:suggestion
106-
107-
# Expression-level preferences
108-
csharp_prefer_simple_default_expression = true:suggestion
109-
csharp_style_deconstructed_variable_declaration = true:suggestion
110-
csharp_style_pattern_local_over_anonymous_function = true:suggestion
111-
112-
# Null-checking preference
87+
# Null-checking preferences
11388
csharp_style_throw_expression = true:suggestion
11489
csharp_style_conditional_delegate_call = true:suggestion
115-
116-
# Code block preferences
117-
csharp_prefer_braces = true:suggestion
118-
119-
## Formatting conventions
120-
# Dotnet formatting settings:
121-
[*.{cs,vb}]
122-
# Organize usings
123-
dotnet_sort_system_directives_first = true
124-
dotnet_separate_import_directive_groups = false
125-
126-
# CSharp formatting settings:
127-
[*.cs]
128-
# Newline options
90+
# Modifier preferences
91+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
92+
# Expression-level preferences
93+
csharp_prefer_braces = true # Prefer curly braces even for one line of code
94+
csharp_style_deconstructed_variable_declaration = true:suggestion
95+
csharp_prefer_simple_default_expression = true:suggestion
96+
# csharp_style_prefer_local_over_anonymous_function = true:suggestion
97+
csharp_style_inlined_variable_declaration = true:suggestion
98+
###############################
99+
# C# Formatting Rules #
100+
###############################
101+
# New line preferences
129102
csharp_new_line_before_open_brace = all
130103
csharp_new_line_before_else = true
131104
csharp_new_line_before_catch = true
132105
csharp_new_line_before_finally = true
133106
csharp_new_line_before_members_in_object_initializers = true
134107
csharp_new_line_before_members_in_anonymous_types = true
135108
csharp_new_line_between_query_expression_clauses = true
136-
137-
# Identation options
138-
csharp_indent_block_contents = true
139-
csharp_indent_braces = false
140-
csharp_indent_case_contents_when_block = true
141-
csharp_indent_switch_labels = true
109+
# Indentation preferences
142110
csharp_indent_case_contents = true
143-
csharp_indent_labels = no_change
144-
145-
# Spacing options
111+
csharp_indent_switch_labels = true
112+
csharp_indent_labels = flush_left
113+
# Space preferences
146114
csharp_space_after_cast = false
147115
csharp_space_after_keywords_in_control_flow_statements = true
148-
csharp_space_between_method_declaration_parameter_list_parentheses = false
149116
csharp_space_between_method_call_parameter_list_parentheses = false
117+
csharp_space_between_method_declaration_parameter_list_parentheses = false
150118
csharp_space_between_parentheses = false
151119
csharp_space_before_colon_in_inheritance_clause = true
152120
csharp_space_after_colon_in_inheritance_clause = true
153121
csharp_space_around_binary_operators = before_and_after
154122
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
155123
csharp_space_between_method_call_name_and_opening_parenthesis = false
156124
csharp_space_between_method_call_empty_parameter_list_parentheses = false
157-
csharp_space_after_comma = true
158-
csharp_space_after_dot = false
159-
csharp_space_after_semicolon_in_for_statement = true
160-
csharp_space_around_declaration_statements = do_not_ignore
161-
csharp_space_before_comma = false
162-
csharp_space_before_dot = false
163-
csharp_space_before_open_square_brackets = false
164-
csharp_space_before_semicolon_in_for_statement = false
165-
csharp_space_between_empty_square_brackets = false
166-
csharp_space_between_method_declaration_name_and_open_parenthesis = false
167-
csharp_space_between_square_brackets = false
168-
169-
# Wrap options
125+
# Wrapping preferences
170126
csharp_preserve_single_line_statements = true
171127
csharp_preserve_single_line_blocks = true
172128

173-
## Naming conventions
174-
[*.{cs,vb}]
129+
# Namespace settings
130+
# csharp_style_namespace_declarations = file_scoped
175131

176-
## Naming styles
177-
178-
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
179-
dotnet_naming_style.camel_case_style.capitalization = camel_case
180-
181-
# PascalCase with I prefix
182-
dotnet_naming_style.interface_style.capitalization = pascal_case
183-
dotnet_naming_style.interface_style.required_prefix = I
184-
185-
# PascalCase with T prefix
186-
dotnet_naming_style.type_parameter_style.capitalization = pascal_case
187-
dotnet_naming_style.type_parameter_style.required_prefix = T
188-
189-
# camelCase with _ prefix
190-
dotnet_naming_style._camelCase.capitalization = camel_case
191-
dotnet_naming_style._camelCase.required_prefix = _
192-
193-
## Rules
194-
# Interfaces
195-
dotnet_naming_symbols.interface_symbol.applicable_kinds = interface
196-
dotnet_naming_symbols.interface_symbol.applicable_accessibilities = *
197-
dotnet_naming_rule.interface_naming.symbols = interface_symbol
198-
dotnet_naming_rule.interface_naming.style = interface_style
199-
dotnet_naming_rule.interface_naming.severity = suggestion
200-
201-
# Classes, Structs, Enums, Properties, Methods, Events, Namespaces
202-
dotnet_naming_symbols.class_symbol.applicable_kinds = class, struct, enum, property, method, event, namespace
203-
dotnet_naming_symbols.class_symbol.applicable_accessibilities = *
204-
205-
dotnet_naming_rule.class_naming.symbols = class_symbol
206-
dotnet_naming_rule.class_naming.style = pascal_case_style
207-
dotnet_naming_rule.class_naming.severity = suggestion
208-
209-
# Type Parameters
210-
dotnet_naming_symbols.type_parameter_symbol.applicable_kinds = type_parameter
211-
dotnet_naming_symbols.type_parameter_symbol.applicable_accessibilities = *
212-
213-
dotnet_naming_rule.type_parameter_naming.symbols = type_parameter_symbol
214-
dotnet_naming_rule.type_parameter_naming.style = type_parameter_style
215-
dotnet_naming_rule.type_parameter_naming.severity = suggestion
216-
217-
# Private const fields
218-
dotnet_naming_symbols.const_field_symbol.applicable_kinds = field
219-
dotnet_naming_symbols.const_field_symbol.applicable_accessibilities = private
220-
dotnet_naming_symbols.const_field_symbol.required_modifiers = const
221-
222-
dotnet_naming_rule.const_field_naming.symbols = const_field_symbol
223-
dotnet_naming_rule.const_field_naming.style = _camelCase
224-
dotnet_naming_rule.const_field_naming.severity = suggestion
225-
226-
# Other const fields
227-
dotnet_naming_symbols.const_field_symbol.applicable_kinds = field
228-
dotnet_naming_symbols.const_field_symbol.applicable_accessibilities = *
229-
dotnet_naming_symbols.const_field_symbol.required_modifiers = const
230-
231-
dotnet_naming_rule.const_field_naming.symbols = const_field_symbol
232-
dotnet_naming_rule.const_field_naming.style = pascal_case_style
233-
dotnet_naming_rule.const_field_naming.severity = suggestion
234-
235-
# Public fields
236-
dotnet_naming_symbols.public_field_symbol.applicable_kinds = field
237-
dotnet_naming_symbols.public_field_symbol.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
238-
239-
dotnet_naming_rule.public_field_naming.symbols = public_field_symbol
240-
dotnet_naming_rule.public_field_naming.style = pascal_case_style
241-
dotnet_naming_rule.public_field_naming.severity = suggestion
242-
243-
# Other fields
244-
dotnet_naming_symbols.other_field_symbol.applicable_kinds = field
245-
dotnet_naming_symbols.other_field_symbol.applicable_accessibilities = *
246-
247-
dotnet_naming_rule.other_field_naming.symbols = other_field_symbol
248-
dotnet_naming_rule.other_field_naming.style = _camelCase
249-
dotnet_naming_rule.other_field_naming.severity = suggestion
132+
[*.json]
133+
indent_size = 2
250134

251-
# Everything Else
252-
dotnet_naming_symbols.everything_else.applicable_kinds = *
253-
dotnet_naming_symbols.everything_else.applicable_accessibilities = *
135+
[*.{ps1,psm1}]
136+
indent_size = 4
254137

255-
dotnet_naming_rule.everything_else_naming.symbols = everything_else
256-
dotnet_naming_rule.everything_else_naming.style = camel_case_style
257-
dotnet_naming_rule.everything_else_naming.severity = suggestion
138+
[*.sh]
139+
indent_size = 4
140+
end_of_line = lf

package.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
55
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
66
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
7-
<Version>5.1.2</Version>
8-
<FileVersion>5.1.2</FileVersion>
9-
<AssemblyVersion>5.1.2</AssemblyVersion>
7+
<Version>5.1.3</Version>
8+
<FileVersion>5.1.3</FileVersion>
9+
<AssemblyVersion>5.1.3</AssemblyVersion>
1010
<Authors>[email protected];</Authors>
1111
<Copyright>Copyright 2023 Lewis Zou</Copyright>
1212
<Description>DotnetSpider, a .NET Standard web crawling library. It is lightweight, efficient and fast high-level web crawling &amp; scraping framework</Description>

src/DotnetSpider.Agent/DotnetSpider.Agent.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8</TargetFramework>
66
</PropertyGroup>
77

88
<Import Project="../../package.props" />
@@ -20,9 +20,9 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
24-
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
23+
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
24+
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
2525
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
26-
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="3.1.0" />
26+
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="4.1.0" />
2727
</ItemGroup>
2828
</Project>

0 commit comments

Comments
 (0)