bpo-30971: Improve code readability of json.tool#2720
Conversation
|
@dhimmel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @tiran and @berkerpeksag to be potential reviewers. |
Sorry, something went wrong.
dhimmel
left a comment
There was a problem hiding this comment.
I left inline comments for the motivation behind each change.
Sorry, something went wrong.
|
We generally don't make changes like these unless we are modifying the code for other reasons. |
Sorry, something went wrong.
nirs
left a comment
There was a problem hiding this comment.
Nice!
Sorry, something went wrong.
Use --sort-keys help message based on the json.tool docs at https://docs.python.org/3.6/library/json.html#basic-usage: > If sort_keys is true, then the output of dictionaries > will be sorted by key.
|
Sorry, something went wrong.
|
This absolutely needs an issue to discuss whether or not to apply it. We probably won't, as we don't normally accept "prettify" pull requests. |
Sorry, something went wrong.
Thanks @bitdancer for the guidance. I opened |
Sorry, something went wrong.
Refs https://bugs.python.org/msg298692. Code was descriptive without the comments.
|
I'm closing the pull request in response to the advice received in Specifically from @bitdancer:
And from @berkerpeksag:
Will rebase my other PRs with json.tool enhancements on top of these changes. |
Sorry, something went wrong.
Several months ago I worked on pull requests to add new options to the
json.toolcommand line utility. These pull requests are still open, pending further design discussion and consensus on whether to add them:bpo-29636).bpo-27413).Related, #346 fixed a small testing bug in
json.tooland was merged.Since #345 and #201 have been inactive for some time, I wanted to take the non-controversial code changes from those PRs. This PR contains readability improvements and minor refactoring to
json.tool. The goal is to get some of the previous work merged and make thejson.toolsource easier to maintain and enhance going forward. Admittedly, the changes are quite minor.