我有一个python脚本,flake8检测到我的脚本有一些错误:
231 flake8
E128 continuation line under-indented for visual indent
232 flake8
E128 continuation line under-indented for visual indent
234 flake8
E128 continuation line under-indented for visual indent
235 flake8
E122 continuation line missing indentation or outdented
236 flake8
E122 continuation line missing indentation or outdented
下面是我的代码:
t = someFunction (
data, title=so, Rows=1,
Widths=[1.2 * inch, 0.3 * inch,
0.1 * inch, 0.3 * inch, 2 * inch, 3 * inch,
5.00 * inch],
style=[("sth1", (0, 0), (-1, -1), "CENTER"),
("sth2", (0, 0), (-1, -1), "CENTER"),
('sth3', (0, 0), (-1, -1), 0.5, colors.grey),
('sth4', (0, 0), (-1, 0), colors.orange),
('sth5', (0, 1), (0, -1), colors.orange),
])
我尝试了不同的排列,但都不起作用。有人能告诉我如何格式化这个函数吗?
发布于 2019-09-13 04:43:05
E122:当您对一个函数的多个参数使用连续行时,它们应该使用普通的4列缩进。
E128:当您将列表、字典、元组等元素分布到多行时,需要将它们靠左对齐。
t = someFunction (
Widths=[1.2 * inch, 0.3 * inch,
0.1 * inch, 0.3 * inch, 2 * inch, 3 * inch,
5.00 * inch],
style=[("sth1", (0, 0), (-1, -1), "CENTER"),
("sth2", (0, 0), (-1, -1), "CENTER"),
('sth3', (0, 0), (-1, -1), 0.5, colors.grey),
('sth4', (0, 0), (-1, 0), colors.orange),
('sth5', (0, 1), (0, -1), colors.orange)]
)
以下是文档:
https://stackoverflow.com/questions/57913873
复制相似问题