{"action":"created","issue":{"url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/481","labels_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/481/comments","events_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/481/events","html_url":"https://github.com/sigmavirus24/github3.py/pull/481","id":117010969,"number":481,"title":"Prettify all existing and future cassettes.","user":{"login":"bboe","id":48100,"avatar_url":"https://avatars.githubusercontent.com/u/48100?v=3","gravatar_id":"","url":"https://api.github.com/users/bboe","html_url":"https://github.com/bboe","followers_url":"https://api.github.com/users/bboe/followers","following_url":"https://api.github.com/users/bboe/following{/other_user}","gists_url":"https://api.github.com/users/bboe/gists{/gist_id}","starred_url":"https://api.github.com/users/bboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboe/subscriptions","organizations_url":"https://api.github.com/users/bboe/orgs","repos_url":"https://api.github.com/users/bboe/repos","events_url":"https://api.github.com/users/bboe/events{/privacy}","received_events_url":"https://api.github.com/users/bboe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-15T19:00:04Z","updated_at":"2015-11-16T03:53:42Z","closed_at":"2015-11-16T02:29:34Z","pull_request":{"url":"https://api.github.com/repos/sigmavirus24/github3.py/pulls/481","html_url":"https://github.com/sigmavirus24/github3.py/pull/481","diff_url":"https://github.com/sigmavirus24/github3.py/pull/481.diff","patch_url":"https://github.com/sigmavirus24/github3.py/pull/481.patch"},"body":"With this PR, all updates to cassettes will be trivial to visually diff as all existing cassettes are prettified, and any new cassettes will also be prettified.\r\n\r\nTo do this, I created the following simple program `fix.py` which uses the same json format as [prettyjson](https://gitlab.com/betamax/serializers/blob/master/betamax_serializers/pretty_json.py):\r\n\r\n    #!/usr/bin/env python\r\n    import json\r\n    import sys\r\n\r\n    data = json.load(sys.stdin)\r\n    json.dump(data, sys.stdout, sort_keys=True, indent=2,\r\n              separators=(',', ': '))\r\n\r\nI then ran:\r\n\r\n    for file in tests/cassettes/*; do mv $file $file.old; \\\r\n        ./fix.py < $file.old > $file; done\r\n\r\nI don't fully expect this to be merged, but I thought I would put it out there as it was pretty simple to do and I think it adds some value as it provides an ability to verify that modifications to existing tests only result in expected changes to their associated cassettes."},"comment":{"url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/comments/156908983","html_url":"https://github.com/sigmavirus24/github3.py/pull/481#issuecomment-156908983","issue_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/481","id":156908983,"user":{"login":"bboe","id":48100,"avatar_url":"https://avatars.githubusercontent.com/u/48100?v=3","gravatar_id":"","url":"https://api.github.com/users/bboe","html_url":"https://github.com/bboe","followers_url":"https://api.github.com/users/bboe/followers","following_url":"https://api.github.com/users/bboe/following{/other_user}","gists_url":"https://api.github.com/users/bboe/gists{/gist_id}","starred_url":"https://api.github.com/users/bboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboe/subscriptions","organizations_url":"https://api.github.com/users/bboe/orgs","repos_url":"https://api.github.com/users/bboe/repos","events_url":"https://api.github.com/users/bboe/events{/privacy}","received_events_url":"https://api.github.com/users/bboe/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T03:53:42Z","updated_at":"2015-11-16T03:53:42Z","body":"Looks like there is already some documentation for it: http://betamax.readthedocs.org/en/latest/introduction.html?highlight=prettyjson#recording-more-complex-cassettes"}}