diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bd730489b7..18e4a84902 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,12 @@ { "recommendations": [ + "esbenp.prettier-vscode", + "ms-python.python", + "ms-python.vscode-pylance", + "charliermarsh.ruff", + "tamasfe.even-better-toml", + "editorconfig.editorconfig", + "matangover.mypy", "DragMZ.teal" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..ada06fe885 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,49 @@ +{ + // General - see also /.editorconfig + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + // Don't want to use isort because it conflicts with Ruff - see run on save below + "source.organizeImports": true, + "source.fixAll": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "files.exclude": { + "**/.git": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + ".mypy_cache": true, + ".pytest_cache": true, + ".ruff_cache": true, + "**/__pycache__": true, + ".idea": true + }, + + // Python + "python.defaultInterpreterPath": "${workspaceFolder}/.venv", + "python.analysis.extraPaths": ["${workspaceFolder}/src"], + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff" + }, + "python.analysis.typeCheckingMode": "basic", + "ruff.enable": true, + "ruff.lint.run": "onSave", + "ruff.lint.args": ["--config=pyproject.toml"], + "ruff.importStrategy": "fromEnvironment", + "ruff.fixAll": true, //lint and fix all files in workspace + "ruff.organizeImports": true, //organize imports on save + "ruff.codeAction.disableRuleComment": { + "enable": true + }, + "ruff.codeAction.fixViolation": { + "enable": true + }, + + "mypy.configFile": "pyproject.toml", + // set to empty array to use config from project + "mypy.targets": [], + "mypy.runUsingActiveInterpreter": true, + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + + "python.testing.pytestArgs": ["."] +}