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
Make it possible to adjust the attributes used when comparing nodes. #67
Conversation
Subclasses can use this determine which attributes for a node should be considered when diffing. By default, they are all considered.
Just to note that the tests are passing, but travis is failing because black is unhappy with the formatting of code that is not part of this PR. |
What is the use case for this? This is, after all, a differ, it should show differences. |
I'm using xmldiff to compare XML documents which I'm then showing to the user. The documents are allowed to differ on some attributes. I don't want to remove them from the XML tree before diffing, since I still want to show the attributes, I simply want to ignore them for diff purposes. This is a bit like git or GitHub's "ignore whitespace in diffs" feature: in some situations it helps the user to make sense of the differences, even though it's not strictly accurate. I didn't want to add this entire feature to xmldiff, so I simply want to make it a bit easier for me (and others) to implement this. |
OK. Could you rebase on master, I've fixed the Travis failinings. |
@regebro thanks -- rebased and added my name to the contributor list. The CHANGES.rst is also updated. |
Pull Request Test Coverage Report for Build 254
💛 - Coveralls |
Thanks @regebro ! Do you think you will be able to release to pypi soon? |
Subclasses can use this determine which attributes for a node should be considered when diffing. By default, they are all considered.
This makes it possible to ignore an attribute on a particular node when calculating diffs, without removing it from the XML tree before hand and having to add it back after the diff.