Skip to content

Instantly share code, notes, and snippets.

@benoit74
Created April 27, 2023 06:50
Show Gist options
  • Save benoit74/0bf067fcf6d2068ece1bff0aef451376 to your computer and use it in GitHub Desktop.
Save benoit74/0bf067fcf6d2068ece1bff0aef451376 to your computer and use it in GitHub Desktop.
Visual Studio Code settings for Python with black, isort and flake8
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"isort.args": [
"--profile",
"black"
],
"python.formatting.provider": "none",
"python.formatting.blackPath": "/Users/benoit/.pyenv/shims/black",
"git.openRepositoryInParentFolders": "always",
"flake8.args": ["--max-line-length=88"],
}
@benoit74
Copy link
Author

To be placed in your project folder in .vscode/settings.json
Works well only with Visual Studio Code extensions "Black Formatter", "isort" and "Flake8"
Replace /Users/benoit/.pyenv/shims/black with the path to your black installation, not really clear for me why I had to do this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment