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

问题描述 投票:0回答:0

想在Visual Studio Code中使用autosave,应用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
  }
}
python autosave isort
© www.soinside.com 2019 - 2024. All rights reserved.