小编Won*_*nee的帖子

在 vscode 中使用黑色和 isort 自动保存时,isort 不起作用

我想在 Visual Studio Code 中使用自动保存并应用 flake8、mypy、isort 和 black 等常用工具。

Flake8、mypy 和 black 工作正常,但 isort 根本不工作。有办法解决这个问题吗?

我的 settings.json 文件如下所示:

{
  "python.terminal.activateEnvInCurrentTerminal": false,
  "python.defaultInterpreterPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
  "python.linting.enabled": true,
  "python.linting.lintOnSave": true,
  "python.linting.pylintEnabled": false,
  "python.linting.flake8Enabled": true,
  "python.linting.flake8Path": "${workspaceFolder}\\.venv\\Scripts\\pflake8.exe",
  "python.linting.mypyEnabled": true,
  "python.formatting.provider": "black",
  "[python]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    },
    "editor.formatOnSave": true
  }
}
Run Code Online (Sandbox Code Playgroud)

python autosave isort

5
推荐指数
1
解决办法
2077
查看次数

标签 统计

autosave ×1

isort ×1

python ×1