E128 continuation line under-indented for visual indent 和 E122 continuation line missing indentation or outdented in flake8

E128 continuation line under-indented for visual indent and E122 continuation line missing indentation or outdented in flake8

我有一个 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),
        ])

我尝试了不同的排列方式,none 成功了。谁能告诉我如何格式化这个函数?

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)]
)

这是文档:

Continuation line missing indentation or outdented (E122)

Continuation line under-indented for visual indent (E128)