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

Dict format make value indent at key level when there is if expr in values #991

Closed
jiamo opened this issue Aug 21, 2019 · 1 comment
Closed

Comments

@jiamo
Copy link

jiamo commented Aug 21, 2019

Howdy! Sorry you're having trouble. To expedite your experience,
provide some basics for me:
Operating system:
mac_os_x: 10.14.5
Python version:
3.7.3
Black version:
black, version 19.3b0
Does also happen on master:
yes

such as:

        {
            "event_type": "album_comment",
            "album_id": album_id,
            "user_id": user_id,
            "comment_id": str(comment_obj.id),
-            "parent_comment_id":
-                str(comment_obj.parent_comment_id) if comment_obj.parent_comment_id else '',
-            "reply_comment_id":
-                str(comment_obj.reply_comment_id) if comment_obj.reply_comment_id else '',
+            "parent_comment_id": str(comment_obj.parent_comment_id)
+            if comment_obj.parent_comment_id
+            else '',
+            "reply_comment_id": str(comment_obj.reply_comment_id)
+            if comment_obj.reply_comment_id
+            else '',
            "time": datetime.datetime.utcnow(),
        }

While I think the if should not at the same level as the another keys.

@zsol
Copy link
Collaborator

zsol commented Aug 21, 2019

Duplicate of #620.

@zsol zsol closed this as completed Aug 21, 2019
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