Bob Ippolito added the comment:
Probably the best thing we could do here is to mirror the options available in
similar tools, such as jq: https://stedolan.github.io/jq/manual/#Invokingjq
The relevant options here would be:
--indent
--tab
--compact-output
--sort-keys
The default indent in jq is 2, which I tend to prefer these days, but maybe 4
is still appropriate given PEP 8:
$ echo '[{}, {"a": "b"}, 2, 3, 4]' | jq
[
{},
{
"a": "b"
},
2,
3,
4
]
This is how jq interprets --compact-output:
$ echo '[{}, {"a": "b"}, 2, 3, 4]' | jq --compact-output
[{},{"a":"b"},2,3,4]
I do not think that it's worth having the command-line tool cater to people
that want to indent in other ways (e.g. using a string that isn't all spaces or
a single tab).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com