Muh*_*ash 9 python visual-studio-code python-black
我刚刚开始在 Visual Studio Code 中使用“ Black ”格式化程序模块。一切都很顺利,直到我注意到它使用双引号而不是我已经在代码中使用的单引号......并且它覆盖了......
那么,是否有一个 Black 参数可以添加到 Visual Studio Code 中来解决这个问题?
Fli*_*rPA 24
--skip-string-normalization您可以在命令行或 Visual Studio Code 选项中使用该选项。
例如:
{
...
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--skip-string-normalization",
"--line-length",
"100"
]
...
}
Run Code Online (Sandbox Code Playgroud)
小智 10
我不知道这一切对你来说如何运作:
{
...
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--skip-string-normalization"
]
...
}
Run Code Online (Sandbox Code Playgroud)
或者
{
...
"python.formatting.blackArgs": [
"-S"
],
...
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试了一切,唯一对我有用的是:
"black-formatter.args": ["-S"]
Run Code Online (Sandbox Code Playgroud)
VSCode 由于某种原因通过安装pip install -U black,不知道它是否重要。
| 归档时间: |
|
| 查看次数: |
14389 次 |
| 最近记录: |