Ant*_*oro 13 python flake8 python-black
每当有一个内联断言规则需要针对 bool 语句进行验证时,在 VSCode 中使用 python black 格式化程序都会破坏该行,导致 flake8 发出有关规则 W503 的警告
line break before binary operatorflake8(W503)
assert (
...
!= ...
)
Run Code Online (Sandbox Code Playgroud)
有没有解决这个问题而不是忽略该规则的方法?
Ant*_*ile 39
你已经ignore =
在你的配置中设置了——你应该使用extend-ignore =
W504
并且W503
相互冲突(默认情况下都被禁用)——通过设置ignore
您可以重新启用它们。extend-ignore
不存在此问题,因为它增加了默认的忽略代码集
请注意,使用黑色时,您需要使用黑色的推荐设置:https://github.com/psf/black/blob/06ccb88bf2bd35a4dc5d591bb296b5b299d07323/docs/guides/using_black_with_other_tools.md#flake8
max-line-length = 88
extend-ignore = E203
Run Code Online (Sandbox Code Playgroud)
免责声明:我是当前 flake8 的维护者