From 3bf65b9b26589c8e54c392c5c36e960f95b3f9e5 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Fri, 29 Aug 2014 15:55:19 +0200 Subject: [PATCH] Add a newline add the end of the JSON file Editors like Vim add a newline at the end of the file when saving. git then complains loudly about the "change": -] \ No newline at end of file +] Add a newline to the JSON file to be compatible with editors. --- sloth/annotations/container.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sloth/annotations/container.py b/sloth/annotations/container.py index 618240d..aeb0681 100644 --- a/sloth/annotations/container.py +++ b/sloth/annotations/container.py @@ -313,6 +313,7 @@ class JsonContainer(AnnotationContainer): """ f = open(fname, "w") json.dump(annotations, f, indent=4, separators=(',', ': '), sort_keys=True) + f.write("\n") class MsgpackContainer(AnnotationContainer):