Skip to content

Commit 806c1a8

Browse files
authored
V0.13.2 (#8)
* Refactored diffing strategy pipeline categories * fixed bug in textnodefilter * Code clean up * 0.13.2 done
1 parent ac7362c commit 806c1a8

File tree

103 files changed

+1414
-370
lines changed

Some content is hidden

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

103 files changed

+1414
-370
lines changed

.editorconfig

-16
This file was deleted.

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.13.2
2+
3+
Released on Thursday, December 27, 2019.
4+
5+
- Added code documentation to all public methods.
6+
- Refactored IDiffingStrategyCollection's methods to take a `StrategyType strategyType = StrategyType.Specialized` as input instead of `bool isSpecialized* = true` argument.
7+
- Fixed bug where `TextNodeFilter` would not give `<style>` and `<script>` the `WhitespaceOption.Preserve` by default.
8+
- Fixed bug where `IgnoreElementComparer` would not change a current decision to SKip if it was Same.
9+
110
# 0.13.1
211

312
Released on Thursday, December 26, 2019.

src/.editorconfig

+227
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
# C# files
5+
[*.cs]
6+
7+
#### Core EditorConfig Options ####
8+
9+
# Indentation and spacing
10+
indent_size = 4
11+
indent_style = space
12+
tab_width = 4
13+
trim_trailing_whitespace = true
14+
15+
# New line preferences
16+
end_of_line = crlf
17+
insert_final_newline = false
18+
19+
#### .NET Coding Conventions ####
20+
21+
# Organize usings
22+
dotnet_separate_import_directive_groups = true
23+
dotnet_sort_system_directives_first = true
24+
25+
# this. and Me. preferences
26+
dotnet_style_qualification_for_event = false:silent
27+
dotnet_style_qualification_for_field = false:silent
28+
dotnet_style_qualification_for_method = false:silent
29+
dotnet_style_qualification_for_property = false:silent
30+
31+
# Language keywords vs BCL types preferences
32+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
33+
dotnet_style_predefined_type_for_member_access = true:silent
34+
35+
# Parentheses preferences
36+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
37+
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
38+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
39+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
40+
41+
# Modifier preferences
42+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
43+
44+
# Expression-level preferences
45+
dotnet_style_coalesce_expression = true:suggestion
46+
dotnet_style_collection_initializer = true:suggestion
47+
dotnet_style_explicit_tuple_names = true:suggestion
48+
dotnet_style_null_propagation = true:suggestion
49+
dotnet_style_object_initializer = true:suggestion
50+
dotnet_style_prefer_auto_properties = true:silent
51+
dotnet_style_prefer_compound_assignment = true:suggestion
52+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
53+
dotnet_style_prefer_conditional_expression_over_return = true:silent
54+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
55+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
56+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
57+
58+
# Field preferences
59+
dotnet_style_readonly_field = true:suggestion
60+
61+
# Parameter preferences
62+
dotnet_code_quality_unused_parameters = all:suggestion
63+
64+
#### C# Coding Conventions ####
65+
66+
# var preferences
67+
csharp_style_var_elsewhere = true:silent
68+
csharp_style_var_for_built_in_types = true:silent
69+
csharp_style_var_when_type_is_apparent = true:silent
70+
71+
# Expression-bodied members
72+
csharp_style_expression_bodied_accessors = true:silent
73+
csharp_style_expression_bodied_constructors = true:silent
74+
csharp_style_expression_bodied_indexers = true:silent
75+
csharp_style_expression_bodied_lambdas = true:silent
76+
csharp_style_expression_bodied_local_functions = true:silent
77+
csharp_style_expression_bodied_methods = true:silent
78+
csharp_style_expression_bodied_operators = true:silent
79+
csharp_style_expression_bodied_properties = true:silent
80+
81+
# Pattern matching preferences
82+
csharp_style_pattern_matching_over_as_with_null_check = true:warning
83+
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
84+
csharp_style_prefer_switch_expression = true:suggestion
85+
86+
# Null-checking preferences
87+
csharp_style_conditional_delegate_call = true:suggestion
88+
89+
# Modifier preferences
90+
csharp_prefer_static_local_function = true:suggestion
91+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
92+
93+
# Code-block preferences
94+
csharp_prefer_braces = when_multiline:silent
95+
csharp_prefer_simple_using_statement = true:suggestion
96+
97+
# Expression-level preferences
98+
csharp_prefer_simple_default_expression = true:suggestion
99+
csharp_style_deconstructed_variable_declaration = true:suggestion
100+
csharp_style_inlined_variable_declaration = true:warning
101+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
102+
csharp_style_prefer_index_operator = true:suggestion
103+
csharp_style_prefer_range_operator = true:suggestion
104+
csharp_style_throw_expression = true:suggestion
105+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
106+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
107+
108+
# 'using' directive preferences
109+
csharp_using_directive_placement = outside_namespace:suggestion
110+
111+
#### C# Formatting Rules ####
112+
113+
# New line preferences
114+
csharp_new_line_before_catch = true
115+
csharp_new_line_before_else = true
116+
csharp_new_line_before_finally = true
117+
csharp_new_line_before_members_in_anonymous_types = true
118+
csharp_new_line_before_members_in_object_initializers = true
119+
csharp_new_line_before_open_brace = all
120+
csharp_new_line_between_query_expression_clauses = true
121+
122+
# Indentation preferences
123+
csharp_indent_block_contents = true
124+
csharp_indent_braces = false
125+
csharp_indent_case_contents = true
126+
csharp_indent_case_contents_when_block = false
127+
csharp_indent_labels = no_change
128+
csharp_indent_switch_labels = true
129+
130+
# Space preferences
131+
csharp_space_after_cast = false
132+
csharp_space_after_colon_in_inheritance_clause = true
133+
csharp_space_after_comma = true
134+
csharp_space_after_dot = false
135+
csharp_space_after_keywords_in_control_flow_statements = true
136+
csharp_space_after_semicolon_in_for_statement = true
137+
csharp_space_around_binary_operators = before_and_after
138+
csharp_space_around_declaration_statements = false
139+
csharp_space_before_colon_in_inheritance_clause = true
140+
csharp_space_before_comma = false
141+
csharp_space_before_dot = false
142+
csharp_space_before_open_square_brackets = false
143+
csharp_space_before_semicolon_in_for_statement = false
144+
csharp_space_between_empty_square_brackets = false
145+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
146+
csharp_space_between_method_call_name_and_opening_parenthesis = false
147+
csharp_space_between_method_call_parameter_list_parentheses = false
148+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
149+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
150+
csharp_space_between_method_declaration_parameter_list_parentheses = false
151+
csharp_space_between_parentheses = false
152+
csharp_space_between_square_brackets = false
153+
154+
# Wrapping preferences
155+
csharp_preserve_single_line_blocks = true
156+
csharp_preserve_single_line_statements = false
157+
158+
#### Naming styles ####
159+
160+
# Naming rules
161+
162+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
163+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
164+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
165+
166+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
167+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
168+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
169+
170+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
171+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
172+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
173+
174+
dotnet_naming_rule.static_field_should_be_pascal_case.severity = suggestion
175+
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
176+
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
177+
178+
dotnet_naming_rule.const_field_should_be_pascal_case.severity = suggestion
179+
dotnet_naming_rule.const_field_should_be_pascal_case.symbols = const_field
180+
dotnet_naming_rule.const_field_should_be_pascal_case.style = pascal_case
181+
182+
dotnet_naming_rule.private_or_internal_field_should_be_fields_begin_with__.severity = suggestion
183+
dotnet_naming_rule.private_or_internal_field_should_be_fields_begin_with__.symbols = private_or_internal_field
184+
dotnet_naming_rule.private_or_internal_field_should_be_fields_begin_with__.style = fields_begin_with__
185+
186+
# Symbol specifications
187+
188+
dotnet_naming_symbols.interface.applicable_kinds = interface
189+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal
190+
dotnet_naming_symbols.interface.required_modifiers =
191+
192+
dotnet_naming_symbols.static_field.applicable_kinds = field
193+
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal
194+
dotnet_naming_symbols.static_field.required_modifiers = static
195+
196+
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
197+
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private
198+
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
199+
200+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
201+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal
202+
dotnet_naming_symbols.types.required_modifiers =
203+
204+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
205+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal
206+
dotnet_naming_symbols.non_field_members.required_modifiers =
207+
208+
dotnet_naming_symbols.const_field.applicable_kinds = field
209+
dotnet_naming_symbols.const_field.applicable_accessibilities = *
210+
dotnet_naming_symbols.const_field.required_modifiers = const
211+
212+
# Naming styles
213+
214+
dotnet_naming_style.pascal_case.required_prefix =
215+
dotnet_naming_style.pascal_case.required_suffix =
216+
dotnet_naming_style.pascal_case.word_separator =
217+
dotnet_naming_style.pascal_case.capitalization = pascal_case
218+
219+
dotnet_naming_style.begins_with_i.required_prefix = I
220+
dotnet_naming_style.begins_with_i.required_suffix =
221+
dotnet_naming_style.begins_with_i.word_separator =
222+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
223+
224+
dotnet_naming_style.fields_begin_with__.required_prefix = _
225+
dotnet_naming_style.fields_begin_with__.required_suffix =
226+
dotnet_naming_style.fields_begin_with__.word_separator =
227+
dotnet_naming_style.fields_begin_with__.capitalization = camel_case

src/AngleSharp.Diffing.Tests/Core/AttributeComparisonSourceTest.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
using Shouldly;
2-
using System;
1+
using System;
2+
3+
using Shouldly;
4+
35
using Xunit;
46

57
namespace AngleSharp.Diffing.Core

src/AngleSharp.Diffing.Tests/Core/AttributeComparisonTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Shouldly;
2+
23
using Xunit;
34

45
namespace AngleSharp.Diffing.Core

src/AngleSharp.Diffing.Tests/Core/ComparisonSourceTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System;
21
using Shouldly;
2+
33
using Xunit;
44

55
namespace AngleSharp.Diffing.Core

src/AngleSharp.Diffing.Tests/Core/DiffingEngineTestBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected static HtmlDiffer CreateHtmlDiffer(
2727
);
2828
}
2929

30-
class MockDiffingStrategy : IDiffingStrategy
30+
private class MockDiffingStrategy : IDiffingStrategy
3131
{
3232
private readonly Func<ComparisonSource, FilterDecision>? _nodeFilter;
3333
private readonly Func<AttributeComparisonSource, FilterDecision>? _attrFilter;

src/AngleSharp.Diffing.Tests/Core/HtmlDifferenceEngineTest.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
using System;
22
using System.Collections.Generic;
3-
using AngleSharp.Dom;
3+
using System.Linq;
4+
45
using AngleSharp.Diffing.Strategies.NodeStrategies;
6+
using AngleSharp.Dom;
7+
58
using Shouldly;
9+
610
using Xunit;
7-
using System.Linq;
811

912
namespace AngleSharp.Diffing.Core
1013
{
@@ -296,7 +299,7 @@ public void OnlyOnePartHasChildNodes(string control, string test, Type expectedD
296299
results.Count.ShouldBe(2);
297300
results[0].ShouldBeOfType<NodeDiff>();
298301
results[1].ShouldBeOfType(expectedDiffType);
299-
}
302+
}
300303

301304
[Fact(DisplayName = "Comparison sources have their type set correctly")]
302305
public void ComparisonSourcesHaveCorrectType()
@@ -400,7 +403,9 @@ private static IEnumerable<AttributeComparison> AttributeNameMatcher(IDiffContex
400403
foreach (var ctrlAttrSrc in controlAttrs)
401404
{
402405
if (testAttrs.Contains(ctrlAttrSrc.Attribute.Name))
406+
{
403407
yield return new AttributeComparison(ctrlAttrSrc, testAttrs[ctrlAttrSrc.Attribute.Name]);
408+
}
404409
}
405410
}
406411

src/AngleSharp.Diffing.Tests/Core/SourceCollectionTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Linq;
3+
34
using Shouldly;
5+
46
using Xunit;
57

68
namespace AngleSharp.Diffing.Core

src/AngleSharp.Diffing.Tests/Core/SourceMapTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Linq;
3+
34
using Shouldly;
5+
46
using Xunit;
57

68
namespace AngleSharp.Diffing.Core

src/AngleSharp.Diffing.Tests/DiffBuilderTest.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
22
using System.Linq;
3+
34
using AngleSharp.Diffing.Core;
4-
using AngleSharp.Diffing.Strategies;
5+
56
using Shouldly;
7+
68
using Xunit;
79

810
namespace AngleSharp.Diffing

src/AngleSharp.Diffing.Tests/DiffingTestBase.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Collections.Generic;
2-
using AngleSharp;
3-
using AngleSharp.Dom;
4-
using AngleSharp.Html.Parser;
2+
53
using AngleSharp.Diffing.Core;
4+
using AngleSharp.Dom;
5+
66
using Xunit;
77

88
namespace AngleSharp.Diffing

src/AngleSharp.Diffing.Tests/DiffingTestFixture.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using AngleSharp;
2-
using AngleSharp.Dom;
1+
using AngleSharp.Dom;
32
using AngleSharp.Html.Parser;
43

54
namespace AngleSharp.Diffing

src/AngleSharp.Diffing.Tests/ShouldlyTestExtensions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
45
using Shouldly;
56

67
namespace AngleSharp.Diffing

src/AngleSharp.Diffing.Tests/Strategies/AttributeStrategies/AttributeComparerTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using AngleSharp.Diffing.Core;
2+
23
using Shouldly;
4+
35
using Xunit;
46

57
namespace AngleSharp.Diffing.Strategies.AttributeStrategies

0 commit comments

Comments
 (0)