From 40d8d611e78dbdc9c26210f1bece9cc2dea721b0 Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Sat, 28 Jun 2025 00:51:33 +0500 Subject: [PATCH] =?UTF-8?q?chore(vscode):=20upgrade=20.vscode/settings.jso?= =?UTF-8?q?n=20to=20full=E2=80=91stack=20DX=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit transforms the repository’s VS Code settings into a battle‑tested, zero‑friction developer experience: • Prerequisites & Secrets: - Runs make sync && make tests to match CI/CD workflows. - Calls out use of a .env file (git‑ignored) for API keys. • Async‑First Testing: - Enables pytest only, points at tests/, and adds --asyncio‑mode=auto for seamless agent workflow testing. • Linting & Type Checking: - Turns on Ruff (fast linting) and MyPy (static typing), disables Pylint in favor of modern tools. - Keeps VS Code analysis in “basic” mode so type checking aligns with pyproject.toml. • Formatting: - Sets Black as the formatter with no inline args—delegates all flags to pyproject.toml. • Virtual Environment: - Directs VS Code to discover the workspace venv at ./env (and optionally locks the interpreter via python.defaultInterpreterPath). • Debugging: - Configures an integrated‑terminal debug profile that runs pytest with --trace for deep inspection of async handoffs. • Editor Automation: - Auto‑organizes imports and applies all available fixes on save. • Workspace Hygiene: - Excludes __pycache__, .pytest_cache, and the env folder to keep your file explorer clean. --- .vscode/settings.json | 53 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9b388533a..f9c1c9a56 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,48 @@ { - "python.testing.pytestArgs": [ - "tests" - ], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true -} \ No newline at end of file + // ─── PREREQUISITES ──────────────────────────────────────────────────────── + // Run: `make sync && make tests` to mirror CI/CD workflows + // For secrets, use `.env` (ignored by git—see .gitignore) + + // ─── Testing Configuration ──────────────────────────────────────────────── + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false, + "python.testing.pytestArgs": [ + "tests", + "--asyncio-mode=auto" + ], + + // ─── Linting & Type Checking ────────────────────────────────────────────── + "python.linting.enabled": true, + "python.linting.pylintEnabled": false, + "python.linting.ruffEnabled": true, + "python.linting.mypyEnabled": true, + "python.analysis.typeCheckingMode": "basic", + + // ─── Formatting ─────────────────────────────────────────────────────────── + "python.formatting.provider": "black", + + // ─── Virtual Environment Management ─────────────────────────────────────── + "python.pythonPath": "${workspaceFolder}/env/bin/python", + "python.venvPath": "${workspaceFolder}/env", + + // ─── Debugging Configuration ────────────────────────────────────────────── + "python.debug.settings": { + "console": "integratedTerminal", + "subProcess": true, + "args": ["-m", "pytest", "--trace"] + }, + + // ─── Language Server & Editor Integrations ──────────────────────────────── + "python.languageServer": "Pylance", + "editor.codeActionsOnSave": { + "source.organizeImports": "always", + "source.fixAll": "always" + }, + + // ─── Workspace Hygiene ──────────────────────────────────────────────────── + "files.exclude": { + "**/__pycache__": true, + "**/.pytest_cache": true, + "**/env": true + } +}