From e4833c405dd790f31cc03c85446770d1e2b949f3 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 8 Jan 2016 12:26:06 -0800 Subject: [PATCH] Pretty print JSON output. --- static/prettyprint.py | 9 +++++++++ static/verify.sh | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 static/prettyprint.py diff --git a/static/prettyprint.py b/static/prettyprint.py new file mode 100755 index 0000000..18fe8d9 --- /dev/null +++ b/static/prettyprint.py @@ -0,0 +1,9 @@ +#!/usr/bin/python2.7 + +import json +import sys + +json.dump( + json.load(sys.stdin), sys.stdout, + sort_keys=True, indent=4, separators=(',', ': ')) +print diff --git a/static/verify.sh b/static/verify.sh index d834887..77a797e 100755 --- a/static/verify.sh +++ b/static/verify.sh @@ -11,7 +11,6 @@ curl \ --data externs_url=https://www.cosmopolite.org/externs/cosmopolite.js \ --data externs_url=http://www.google.com/uds/modules/gviz/gviz-api.js \ --data-urlencode "js_code@babystats.js" \ - http://closure-compiler.appspot.com/compile -echo + http://closure-compiler.appspot.com/compile | ./prettyprint.py gjslint --strict babystats.js