我目前是开发容器中的开发人员,我正在尝试使用黑色作为 python 的格式化程序。但是,我未能使其工作。这是我的.devcontainer.json
{
"name": "api",
"dockerComposeFile": ["../docker-compose.yml", "../docker-compose.devcontainer.yml"],
"service": "api",
"workspaceFolder": "/workspace/api",
"settings": {
"python.defaultInterpreterPath": "/usr/local/lib/python3.8",
"python.formatting.provider":"black",
"python.formatting.blackPath":"/usr/local/lib/python3.8/site-packages/black",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.mypyEnabled":true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.detectIndentation":false,
"editor.formatOnSave":true,
},
"shutdownAction": "none",
"extensions": ["ms-python.python", "ms-python.vscode-pylance","ms-azuretools.vscode-docker"],
//this is port forwarding for the debugger
"forwardPorts": [8000]
}