psf/black

List concatenation, multiple lines

开放

#260 创建于 2018年5月26日

 (2 条评论) (3 个反应) (0 位负责人)Python (2,693 个派生)batch import
F: linebreakF: symmetryT: enhancementT: stylehelp wanted

仓库指标

星标
 (41,258 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 26 个 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

贡献者指南