JSON pretty-printer
Summary:
This is step one of a three-step plan to build "arc add-certificate" which edits
your .arcrc for you since people had a lot of trouble with it at Facebook and I
imagine it causes Bootcamper issues.
I want to be able to print out the final file in a human-readable way, so we
need a JSON pretty printer / formatter. I looked around online for something
since this seems like a thing I shouldn't have to roll, but all I could find was
one in Zend Framework (which I think has some weird license?) which is broken
and silly:
http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Json.php
It does the wrong thing if any string contains "[", "]", "{" or "}", which is
ridiculous. I also found this:
https://gist.github.com/906036
..but who knows what the license on that is, and it's also based on transforming
a serialized JSON string into a pretty string, which is silly and complicated.
Test Plan:
Wrote a test file with some complicated object in it and pretty-encoded it to a
reasonable outcome.
Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen, jungejason, aran
CC: aran, epriestley, tuomaspelkonen
Differential Revision: 336