I want to store isort
config in a repository (as I do with .editorconfig
).
I went through several resources:
- How to find which isort is vscode exactly using
- VSCode: how to config 'Organize imports' for Python (isort)
- Sorting imports fails on Python VSCode extension
- https://github.com/Microsoft/vscode-python/issues/3306
- isort documentation
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