podhmo / dictknife

armyknife of handling dict object
MIT License
19 stars 4 forks source link

diff with word level diff #178

Closed podhmo closed 3 years ago

podhmo commented 3 years ago

or fancy output

https://eshlox.net/2020/04/07/better-diffs-in-pytest

podhmo commented 3 years ago

https://stackoverflow.com/questions/1721738/using-diff-or-anything-else-to-get-character-level-diff-between-text-files https://github.com/git/git/tree/master/contrib/diff-highlight

podhmo commented 3 years ago
$ port contents git | grep "diff-highlight$"
  /opt/local/bin/diff-highlight
  /opt/local/share/git/contrib/diff-highlight/diff-highlight

$ cat dst/00.diff |  /opt/local/bin/diff-highlight
--- src/000person.json
+++ src/001person.json
@@ -1,5 +1,5 @@
 {
-  "name": "foo",
-  "age": 20,
+  "name": "bar",
+  "age": 21,
   "type": "person"
 }
podhmo commented 3 years ago

use diff-highlight