From 7a3d32653217a9265fdec9bf48098582bb0d0146 Mon Sep 17 00:00:00 2001 From: zackees Date: Wed, 22 Jan 2025 08:39:29 -0800 Subject: [PATCH] chore: add VSCode configuration files for Python development --- .vscode/launch.json | 44 +++++++++++++++++++++++++++++++++ .vscode/settings.json | 57 ++++++++++++++++++++----------------------- .vscode/tasks.json | 41 +++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b97aede --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,44 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File (Integrated Terminal)", + "type": "python", + "request": "launch", + "subProcess": true, + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Python: Remote Attach", + "type": "python", + "request": "attach", + "port": 5678, + "host": "localhost", + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "." + } + ] + }, + { + "name": "Python: Module", + "type": "python", + "request": "launch", + "module": "enter-your-module-name-here", + "console": "integratedTerminal" + }, + { + "name": "Python: Current File (External Terminal)", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "externalTerminal" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 2af85df..329d525 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,31 +1,28 @@ { - "python.autoComplete.extraPaths": [ - "." - ], - "python.analysis.extraPaths": [ - "." - ], - "python.pythonPath": "venv/bin/python", - "python.defaultInterpreterPath": "venv/bin/python", - "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", - "python.linting.pylintEnabled": true, - "files.eol": "\n", // Unix - "editor.tabSize": 4, - "editor.insertSpaces": true, - "editor.detectIndentation": false, - "editor.formatOnSave": true, - "python.formatting.provider": "black", - "python.formatting.blackArgs": [ - "--line-length=100" - ], - "python.sortImports.args": [ - "--profile", - "black" - ], - "[python]": { - "editor.codeActionsOnSave": { - //"source.fixAll": true, - //"source.organizeImports": true - } - }, -} \ No newline at end of file + "python.autoComplete.extraPaths": [ + "." + ], + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "terminal.integrated.defaultProfile.windows": "Git Bash", + "terminal.integrated.profiles.windows": { + "Git Bash": { + "path": "C:\\Program Files\\Git\\bin\\bash.exe", + "args": ["--cd=."] + } + }, + "terminal.integrated.env.windows": { + "VIRTUAL_ENV": "${workspaceFolder}/.venv" + }, + "files.eol": "\n", // Unix + "editor.tabSize": 4, + "editor.insertSpaces": true, + "editor.detectIndentation": false, + "editor.formatOnSave": false, + "python.formatting.provider": "black", + "python.formatting.blackArgs": [ + ], + "python.analysis.extraPaths": [ + "." + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..394ff57 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Lint", + "type": "shell", + "command": ". ./activate.sh && ./lint.sh", + "group": "build", + "options": { + "cwd": "${workspaceRoot}" + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "clear": true + }, + "problemMatcher": [] + }, + { + "label": "Tox", + "type": "shell", + "command": "tox", + "group": "build", + "options": { + "cwd": "${workspaceRoot}" + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "clear": true + }, + "problemMatcher": [] + }, + ] +} \ No newline at end of file