因此,似乎 Black 代码格式化程序默认line-length选项也考虑了该行中包含的注释
例如
if some_very_long_variable_name_out_there_for_example is True: # just a random comment
pass
Run Code Online (Sandbox Code Playgroud)
将在
if (
some_very_long_variable_name_out_there_for_example is True
): # just a random comment
pass
Run Code Online (Sandbox Code Playgroud)
,就黑标准而言,这绝对是正确的
然而,该行if some_very_long_variable_name_out_there_for_example is True:实际上少于 88 个符号,我不希望我的代码因为我添加了注释而在视觉上被破坏
是否有禁用此类行为的选项?
我不使用 Pycharm 作为我的 Python 环境,我的 PC 上也没有它。
然而,我们经常与同事讨论代码风格,虽然我更喜欢黑色,但他们使用内部 PyCharm 格式化程序。
我在 JetBrains 网站上没有找到任何提及,这是什么东西,有什么建议吗?
如果我使用依赖系统,有没有办法将字段描述添加到 FastAPI swagger 模式?
我发现没有地方可以在FastAPI 文档的简单示例中添加描述
async def common_parameters(q: str = None, skip: int = 0, limit: int = 100):
return {"q": q, "skip": skip, "limit": limit}
Run Code Online (Sandbox Code Playgroud)