[Git][reproducible-builds/diffoscope][master] 2 commits: Reflow calculation of jsondiff differences prior to next commit.
    Chris Lamb 
    gitlab at salsa.debian.org
       
    Mon Jan  4 10:35:43 UTC 2021
    
    
  
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
b419df43 by Chris Lamb at 2021-01-04T10:32:03+00:00
Reflow calculation of jsondiff differences prior to next commit.
- - - - -
56d20d09 by Chris Lamb at 2021-01-04T10:34:59+00:00
Truncate jsondiff differences at 512 bytes, lest they consume the entire page.
- - - - -
1 changed file:
- diffoscope/comparators/json.py
Changes:
=====================================
diffoscope/comparators/json.py
=====================================
@@ -94,9 +94,10 @@ class JSONFile(File):
         if similarity:
             difference.add_comment(f"Similarity: {similarity}%")
 
-        difference.add_comment(
-            "Differences: {}".format(pprint.pformat(diff, width=100))
-        )
+        differences = pprint.pformat(diff, width=100)
+        if len(differences) > 512:
+            differences = f"{differences[:512]} […]"
+        difference.add_comment(f"Differences: {differences}")
 
     @staticmethod
     def dumps(file, sort_keys=True):
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/9a68dec60314ab9586e6bbc7188453715faaa756...56d20d0900328b3f876686720161c11fad344e3d
-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/9a68dec60314ab9586e6bbc7188453715faaa756...56d20d0900328b3f876686720161c11fad344e3d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210104/ce52a521/attachment.htm>
    
    
More information about the rb-commits
mailing list