Skip to content
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

Possibility of aligning ":" in output #1201

Open
fedormsv opened this issue Jul 9, 2020 · 3 comments
Open

Possibility of aligning ":" in output #1201

fedormsv opened this issue Jul 9, 2020 · 3 comments

Comments

@fedormsv
Copy link

fedormsv commented Jul 9, 2020

To use json files in a context where human readability makes sense, it's nice to have "name : value" pairs aligned on ":" at least within one object.

@dota17
Copy link
Member

dota17 commented Jul 10, 2020

How about those nested JSON objects, especially long keys?
For example,

{
   ...
   {
      ...
         {
             “long key............................” : ...
             "abc"                               : ...
         }
   }
}

Under some cases, it will make the file's row length even longer.
I think it is sufficiently friendly for readability when we use writer with current indent setting.

What's more, it means that we should calculate the longest indent first in json object, and then insert some blank into other members to make name : value paris aligned on :.

@fedormsv
Copy link
Author

Idea is not on changing names, but to add extra spaces between name closing quote and :. Within one object can be enough. We implemented it as writer builder option, harmless if not changed I believe.

@dota17
Copy link
Member

dota17 commented Jul 10, 2020

I konw this idea is not on changing names, what I means is that adding extra spaces would make the file's row length even longer.
We already have indentations in every level, IMO, it is sufficiently friendly.

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

No branches or pull requests

2 participants