{
// 设置 Python 解释器的路径。
"python.pythonPath": "/path/to/python",
// 启用或禁用自动格式化代码。
"python.formatting.autopep8Enabled": true,
// 自动格式化代码时使用的行宽度。
"python.formatting.autopep8Args": ["--max-line-length=100"],
// 启用或禁用自动排序导入语句。
"python.sortImports.args": ["--force-single-line-imports"],
// 在保存文件时自动排序导入语句。
"python.sortImports.onSave": true,
// 启用或禁用代码提示。
"python.autoComplete.addBrackets": true,
// 配置虚拟环境的查找方式。
"python.venvPath": "${workspaceFolder}/venv",
// 配置文档字符串的格式化方式。
"python.format.docstringFormat": "google"
// 设置 Python 解释器的路径。
"python.pythonPath": "/path/to/python",
// 启用或禁用自动格式化代码。
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": ["--max-line-length=100"],
// 在保存文件时自动格式化代码。
"editor.formatOnSave": true,
// 配置虚拟环境的查找方式。
"python.venvPath": "${workspaceFolder}/venv",
// 自动补全建议的触发字符。
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
// 显示函数参数的提示信息。
"python.hover.showParameters": true,
// 配置运行和调试的 Python 环境。
"python.pythonPath": "/path/to/python",
"python.autoComplete.addBrackets": true,
"python.envFile": "${workspaceFolder}/.env",
// 控制是否显示导入错误。
"python.analysis.diagnosticSeverityOverrides": {
"reportImportCycles": "information",
"reportUnusedImport": "warning"
},
// 启用或禁用 Jupyter Notebook 功能。
"jupyter.enableCellCodeLens": true,
"jupyter.alwaysTrustNotebooks": true,
// 配置单元测试框架。
"python.testing.unittestEnabled": true,
"python.testing.pytestEnabled": false,
// 控制运行测试时的覆盖率报告。
"python.testing.coverageEnabled": true,
"python.testing.coveragePath": ".coverage/",
// 配置虚拟环境的查找方式。
"python.venvFolders": ["envs", ".venv"],
"python.autoComplete.addBrackets": true
}
01-28
5766

04-10
1325

04-03
3811
