-
Notifications
You must be signed in to change notification settings - Fork 21
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
Style Request - More whitespace for json blobs with nested dicts #55
Comments
I personally think getting formatting like this right 100% of the time is impossible. I suggest adding explicit skip comments to prevent reformatting those lines. Although, come to think about it, it might be interesting to implement something like |
Yeah that's fair - especially given the number of permutations here. The explicit skip helps me in this instance, thank you. I like the idea of |
I guess the problem with that is that blue (or black AFAIK) doesn't really semantically know that this is JSON. It just looks like a function call with an argument set to a dictionary. |
Yeah good point - instead of json, maybe a |
Are you on the most recent version of black? I’m guessing there’s something different about the trailing comma handling. Notice that the “type” field doesn’t have a trailing comma in the first post. |
That's a good eye, the code was originally formatted using black v |
I have a black formatted json blob that looks like the following:
After formatting with blue the formatting was changed to the following:
My own personal preference is towards the original formatting since it's much easier to identify field count and pick out the name fields at a glance.
The text was updated successfully, but these errors were encountered: