How to make VSCode read`isort` config from a file?
Asked Answered
B

0

1

I want to store isort config in a repository (as I do with .editorconfig).

I went through several resources:

And this is my config that does not work:

"editor.formatOnSave": true,
    "[python]": {
        "editor.defaultFormatter": "ms-python.python",
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        }
    },
    "python.linting.enabled": true,
    "python.formatting.provider": "black",
    "isort.check": true,
    "isort.logLevel": "debug",
    "isort.args": [
        "--settings",
        "/Users/myname/dev/myproject/.isort.cfg",
    ],

My .isort.cfg

[settings]
profile=hug

On save this is my isort's OUTPUT in VSCode:

/opt/homebrew/bin/python3 -m isort - --settings /Users/myname/dev/myproject/.isort.cfg --filename /Users/myname/dev/myproject/api/src/models/album.py
CWD Linter: /Users/myname/dev/myproject
/opt/homebrew/bin/python3 -m isort - --settings /Users/myname/dev/myproject/.isort.cfg --check --filename /Users/myname/dev/myproject/api/src/models/album.py
CWD Linter: /Users/myname/dev/myproject
Barringer answered 5/11, 2022 at 18:45 Comment(1)
Note to self, this issue might have an answer: github.com/microsoft/vscode-isort/issues/71Barringer

© 2022 - 2024 — McMap. All rights reserved.