Allow setting indent width or character in json.tool by int-ua · Pull Request #426 · python/cpython
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow these steps to help rectify the issue:
- If you don't have an account on b.p.o, please create one
- Make sure your GitHub username is listed in "Your Details" at b.p.o
- If you have not already done so, please sign the PSF contributor agreement. The "bugs.python.org username " requested by the form is the "Login name" field under "Your Details".
- If you just signed the CLA, please wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
- Reply here saying you have completed the above steps
Thanks again to your contribution and we look forward to looking at it!
Wait, #345 doesn't allow tabs.
@int-ua see conversation here. Initially, I had implemented a solution that supported indent='\t', indent=None, and indent corresponding to any int or string. However, the reviewers didn't like the special casing, which I agree is undesirable.
@serhiy-storchaka mentioned:
You can use external commands like
unexpandfor converting spaces to tabs.
It doesn't look like your PR currently supports setting an int indent. I guess you could always pass Let's direct further design discussion to bpo-29636.--indent=" " for two spaces.
It did allow integers, see line 38. Also, to prevent misunderstanding: I don't care at all whose commit is going to be merged, I really appreciate all Python authors' work and I just want tabs, a character created specifically to set indent level. Now, that's all, moving to BPO.
| outfile = options.outfile or sys.stdout | ||
| sort_keys = options.sort_keys | ||
| try: | ||
| indent = int(options.indent) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad... clearly supports int!