-
-
Notifications
You must be signed in to change notification settings - Fork 8
Ignore unmatched :ignore
attributes
#49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
:ignore
attributes
Let me know what you think, I loved how everything is set up, code looks very clean. But maybe my changes could be better placed somewhere else, let me know! |
ee6a978
to
5f19c08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe revert this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe merge the two files into one static file, e.g. IgnoreAttributeStrategy.cs
, have the Compare
and Match
methods in the static class, and then have the static IsIgnoreAttribute
method there being shared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to keep IgnoreAttributeComparer
for backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where unmatched :ignore
attributes were not being properly handled by the diffing engine. Previously, :ignore
attributes that didn't have corresponding attributes in the test HTML would still cause diff failures instead of being ignored as intended.
- Added a new
IgnoreAttributeMatcher
to handle unmatched:ignore
attributes by matching them with themselves - Refactored
IgnoreAttributeComparer
to extract ignore attribute detection logic into a reusable method - Added comprehensive test coverage for various scenarios with
:ignore
attributes
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
IgnoreAttributeMatcher.cs | New matcher strategy that handles unmatched :ignore attributes by self-matching |
IgnoreAttributeComparer.cs | Refactored to extract ignore attribute detection into a reusable method |
DiffingStrategyPipelineBuilderExtensions.cs | Integrated the new ignore attribute matcher into the pipeline |
SourceMap.cs | Updated to use extracted method for unmatched attribute detection |
HtmlDifferenceEngine.cs | Added necessary using statement for attribute strategies |
IgnoreAttributeTestData.cs | New test data class with comprehensive test cases for ignore attribute scenarios |
DiffBuilderTest.cs | Added test methods to verify ignore attribute functionality works correctly |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/AngleSharp.Diffing/Strategies/AttributeStrategies/IgnoreAttributeComparer.cs
Outdated
Show resolved
Hide resolved
I have:
|
2c9ae06
to
082c0d6
Compare
Thanks, I think looks good. Lets ignore the failing Linux build for now. Asked Copilot to change that in a separate PR. |
This reverts commit 2597558.
It was nice contributing! If there are ever open issues and you don't have time, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lets get this merged.
This repository does not have a lot. Feel free to look over the code base, see if there are things that needs updating, e.g. new html elements or Boolean attributes that are counted as boolean. Otherwise, we would love help over in the bUnit repository. |
Types of Changes
Prerequisites
Please make sure you can check the following two boxes:
Contribution Type
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Description
Closes #48