Editor Integration
IDE integration surfaces lint errors, type issues, and formatting fixes as you type. Fast feedback loops keep code clean without waiting for CI.
Search across all documentation pages
IDE integration surfaces lint errors, type issues, and formatting fixes as you type. Fast feedback loops keep code clean without waiting for CI.
VS Code extensions:
charliermarsh.ruff (Ruff)ms-python.mypy-type-checker or built-in Pylance (pyright)// .vscode/settings.json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
},
"ruff.configuration": "pyproject.toml"
}When to reach for this:
// .vscode/settings.json (commit this file)
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"ruff.enable": true,
"ruff.lint.run": "onSave",
"mypy-type-checker.args": ["src/"],
"mypy-type-checker.severity": {
"error": "Error",
"note": "Information"
}
}// .vscode/extensions.json
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.python",
"ms-python.mypy-type-checker"
]
}What this demonstrates:
| Setting | Effect |
|---|---|
formatOnSave | Auto-format with ruff |
source.fixAll.ruff | Auto-fix lint violations |
source.organizeImports.ruff | Sort imports on save |
python.defaultInterpreterPath | Point to project .venv |
pyproject.toml.venv interpreter in VS Code status bar..vscode/settings.json - each dev configures differently. Fix: commit shared settings (not personal keybindings).defaultFormatter to ruff explicitly.| Alternative | Use When | Don't Use When |
|---|---|---|
| CI only | No local setup time | Active development |
| Neovim + conform.nvim | Terminal-centric workflow | Team uses VS Code |
| Zed editor | Lightweight alternative | Need PyCharm Django tools |
Both work well. VS Code + ruff + Pylance is lighter. PyCharm excels for Django refactoring.
Command Palette > Python: Select Interpreter > choose .venv/bin/python.
Pylance (pyright) is fast for editing. mypy in CI catches issues Pylance may miss. Use both or pick one.
Not easily per-file. Use # fmt: off blocks for specific sections.
Use extensions.json for recommendations; settings.json for team defaults. Personal overrides go in user settings.
Install ruff extension. Errors appear as squiggles; hover for rule explanation.
Install Ruff plugin from marketplace. Enable in Settings > Tools > Ruff.
Add extensions to devcontainer.json customizations.vscode.extensions.
Command Palette > Ruff: Fix all auto-fixable problems.
Sync ruff version in pre-commit rev with pyproject.toml dev dependency.
Stack versions: This page was written for Python 3.14.0, FastAPI 0.115+, Django 5.2, Flask 3.1, Pydantic 2, PyTorch 2.6+, pandas 2.2+, Polars 1.x, ruff 0.9+, and uv 0.6+.
Reviewed by Chris St. John·Last updated Jul 19, 2026