Skip to content

bpo-30669: add --indent flag to json.tool #2207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

modulitos
Copy link

@modulitos modulitos commented Jun 15, 2017

Resolves this issue: http://bugs.python.org/issue30669

I have been using the json.tool quite often by running cat my-file.json | python -m json.tool or (:%! python -m json.tool in vim) to pretty print the json file, but I would like to customize the indentation level to 2 indentation spaces instead of default of 4. Unfortunately, json.tool is hard-coded to use 4 spaces for indentation, so I am submitting this PR to enable this ability.

BTW: This is my first PR to cpython, so any suggestions or feedback on this PR would be great :-)

@the-knights-who-say-ni
Copy link

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 our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@modulitos modulitos changed the title add --indent flag to json.tool bpo-30669: add --indent flag to json.tool Jun 15, 2017
@modulitos
Copy link
Author

@the-knights-who-say-ni I have signed the CLA ~20 minutes ago - perhaps is just need some time to propagate? I have a confirmation email if that helps...

@modulitos
Copy link
Author

Looks like this feature is already in progress on http://bugs.python.org/issue29636, #426, and #345

@modulitos modulitos closed this Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants