【发布时间】:2020-04-08 13:16:06
【问题描述】:
我想为我的 Python 文件使用 Black 格式化程序,但不用于我的 JSON 设置。
我在 settings.json 中设置了这些:
"python.formatting.provider": "black",
"editor.formatOnSave": true,
我尝试通过将以下内容添加到 settings.json 来使用 --exclude 标记:
"python.formatting.blackArgs": [
"--exclude /*\\.json/"
],
相当于使用black --exclude /*\.json/进行命令行调用
我也试过了
"python.formatting.blackArgs": [
"--exclude /*\\.json/"
],
基于这篇文章:VS Code Python + Black formatter arguments - python.formatting.blackArgs。
但是,它仍在格式化我的 settings.json。
【问题讨论】:
标签: python visual-studio-code vscode-settings