Skip to content

Commit

Permalink
Merge pull request #4 from algorandfoundation/python-devxp
Browse files Browse the repository at this point in the history
chore: Added Python VS Code configuration
  • Loading branch information
robdmoore authored Dec 8, 2023
2 parents 72b205a + 52de611 commit c8af00d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
49 changes: 49 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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": ["."]
}

0 comments on commit c8af00d

Please sign in to comment.