Created
January 4, 2023 02:38
-
-
Save eevmanu/62af9c62680ab27a326acf513731375a to your computer and use it in GitHub Desktop.
VS Code folder settings example / template for a python project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// -------------------------------------------------------------------------------- | |
// personal code editor config | |
"files.insertFinalNewline": true, | |
"files.trimFinalNewlines": true, | |
"files.trimTrailingWhitespace": true, | |
"files.exclude": { | |
"**/__pycache__": true, | |
"**/*.egg-info": true, | |
"**/.env/**": true, | |
"**/.venv/**": true, | |
"**/.git/objects/**": true, | |
"**/.git/subtree-cache/**": true, | |
"**/site-packages/**": true, | |
"**/.mypy_cache/**": true, | |
"**/.pytest_cache/**": true, | |
"build/": true, | |
}, | |
"search.exclude": { | |
"**/__pycache__": true, | |
"**/*.egg-info": true, | |
"**/.env/**": true, | |
"**/.venv/**": true, | |
"**/.git/objects/**": true, | |
"**/.git/subtree-cache/**": true, | |
"**/site-packages/**": true, | |
"**/.mypy_cache/**": true, | |
"**/.pytest_cache/**": true, | |
"build/": true, | |
}, | |
"files.watcherExclude": { | |
"**/__pycache__": true, | |
"**/*.egg-info": true, | |
"**/.env/**": true, | |
"**/.venv/**": true, | |
"**/.git/objects/**": true, | |
"**/.git/subtree-cache/**": true, | |
"**/site-packages/**": true, | |
"**/.mypy_cache/**": true, | |
"**/.pytest_cache/**": true, | |
"build/": true, | |
}, | |
// "workbench.localHistory.exclude": {} | |
// "markdown.extension.completion.respectVscodeSearchExclude": true | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python binary | |
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", | |
// "python.defaultInterpreterPath": "${env:HOME}/.pyenv/versions/3.8.13/bin/python", | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python extra paths to support autocomplete (by pylance LSP) | |
"python.analysis.extraPaths": [ | |
"${workspaceFolder}/src", | |
// π python autocomplete still required `__init__.py` files to be able to import modules | |
], | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python package manager β£ poetry | |
"python.poetryPath": "${env:HOME}/.local/bin/poetry", | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python linter β£ pylint (or flake8) | |
"python.linting.enabled": true, | |
"python.linting.lintOnSave": true, | |
"python.linting.pylintEnabled": false, | |
// "python.linting.pylintEnabled": true, | |
"python.linting.pylintPath": "${workspaceFolder}/.venv/bin/pylint", | |
"python.linting.pylintArgs": [ | |
"--rcfile=${workspaceFolder}/.pylintrc", | |
// "--max-line-length=88", | |
// "--verbose" | |
], | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python formatters β£ isort, black | |
// TODO isort conf | |
// "python.formatting.provider": "black", | |
// "python.formatting.blackPath": "${workspaceFolder}/.venv/bin/black", | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// python type checking β£ mypy ... | |
// "python.linting.mypyPath": "mypy", | |
// "python.linting.mypyPath": "${workspaceFolder}/.venv/bin/mypy", | |
// "python.linting.mypyEnabled": true, | |
// "python.linting.mypyArgs": [ | |
// "--config-file=${workspaceFolder}/mypy.ini", | |
// // "--follow-imports=silent", | |
// // "--ignore-missing-imports", | |
// // "--show-column-numbers", | |
// // "--no-pretty" | |
// ], | |
// ... or pylance LSP | |
// "python.analysis.typeCheckingMode": "basic", | |
// "python.analysis.xxx" | |
// -------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------- | |
// only on files with a python file extension | |
"[python]": { | |
"editor.detectIndentation": false, | |
"editor.insertSpaces": true, | |
"editor.tabSize": 4, | |
// π because of PEP8 and Black | |
"editor.rulers": [ | |
88, | |
120, | |
], | |
// π enable if using python formatters | |
// "editor.formatOnSave": true, | |
// "editor.formatOnSaveMode": "file" | |
}, | |
// -------------------------------------------------------------------------------- | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment