psf/black

List concatenation, multiple lines

Open

#260 建立於 2018年5月26日

在 GitHub 查看
 (2 留言) (3 反應) (0 負責人)Python (2,693 fork)batch import
F: linebreakF: symmetryT: enhancementT: stylehelp wanted

倉庫指標

Star
 (41,258 star)
PR 合併指標
 (平均合併 8天 13小時) (30 天內合併 33 個 PR)

描述

Probably not a bug, but I was wondering if the code below shouldn't be formatted more like call chains are. I did not expect black to change anything other than quotes in this example. Aligned brackets feel much more readable.

# before
-    search_fields = (
-        ['file__%s' % field for field in FileAdmin.search_fields] +
-        ['resource__%s' % field for field in ResourceAdmin.search_fields]
-    )
# black output
+    search_fields = ["file__%s" % field for field in FileAdmin.search_fields] + [
+        "resource__%s" % field for field in ResourceAdmin.search_fields
+    ]

Operating system: OSX 10.11.6 Python version: 3.6.5 Black version: 18.5b0 Does also happen on master: yes

貢獻者指南