我正在使用 Sort Imports VS Code 的 Python 扩展功能。我想将此行长度配置为 100;但是,我一直无法在我的 settings.json
文件中正确设置它。从文档来看,似乎 "python.sortImports.args": ["-l", "100"]
应该可以工作,但它给了我一个错误:Invalid patch string: Skipped 1 个文件
。
有什么想法吗?
最佳答案
在 __init__.py
文件上使用排序导入有一个已知错误。这是放入 vscode 的 .vscode/settings.json
的完整解决方案:
"python.sortImports.args": ["-ns", "__init__.py", "-l", "100"],
关于python - 如何在用户设置中为 VS Code python Sort Imports 配置行长度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52046251/