Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 482 Bytes

black_isort.md

File metadata and controls

15 lines (12 loc) · 482 Bytes

Use black and isort together in VS Code

VS Code only uses a single formatter at a time. (Also I don't know if import ordering technically counts as a formatter) So there is some additional config needed, to make both happen on save:

This must be changed in settings.json:

{
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "soure.organizeImports": true
    }
}

Of course, set profile=black in some isort config (e.g. pyproject.toml)