Skip to content
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

Merged
merged 5 commits into from Oct 28, 2020

Conversation

longhotsummer
Copy link
Contributor

@longhotsummer longhotsummer commented Oct 23, 2020

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.

Subclasses can use this determine which attributes for a node should be
considered when diffing. By default, they are all considered.
@longhotsummer
Copy link
Contributor Author

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.

@regebro
Copy link
Contributor

regebro commented Oct 25, 2020

What is the use case for this? This is, after all, a differ, it should show differences.

@longhotsummer
Copy link
Contributor Author

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.

@regebro
Copy link
Contributor

regebro commented Oct 26, 2020

OK. Could you rebase on master, I've fixed the Travis failinings.
Also please update the Changes.txt and add yourself to the contributors list.

@longhotsummer
Copy link
Contributor Author

@regebro thanks -- rebased and added my name to the contributor list. The CHANGES.rst is also updated.

@coveralls
Copy link

coveralls commented Oct 26, 2020

Pull Request Test Coverage Report for Build 254

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0004%) to 99.793%

Totals Coverage Status
Change from base Build 252: 0.0004%
Covered Lines: 963
Relevant Lines: 965

💛 - Coveralls

@regebro regebro merged commit 6980256 into Shoobx:master Oct 28, 2020
@longhotsummer longhotsummer deleted the node-attrib branch October 28, 2020 08:23
@longhotsummer
Copy link
Contributor Author

Thanks @regebro ! Do you think you will be able to release to pypi soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants