VSCode Python 개발환경 완벽 설정 가이드 (2025)
· 약 6분
Black, isort, Flake8을 Ruff 하나로 통합하고, 생산성을 극대화하는 VSCode 설정
들어가며
Python 개발을 하다 보면 코드 포맷팅, 린팅, import 정리 등 여러 도구를 조합해서 사용하게 됩니다. 기존에는 Black + isort + Flake8 조합이 일반적이었지만, 이제는 Ruff 하나로 이 모든 것을 대체할 수 있습니다.
이 글에서는 Ruff를 중심으로 한 VSCode Python 개발환경 설정을 정리합니다.
1. 왜 Ruff인가?
기존 방식의 문제점
- 여러 도구 관리: Black, isort, Flake8, pyupgrade 등 각각 설치하고 설정해야 함
- 속도: 대규모 프로젝트에서 린팅/포맷팅에 시간 소요
- 설정 파일 분산: 각 도구마다 별도 설정 필요
Ruff의 장점
| 특징 | 설명 |
|---|---|
| 속도 | Rust로 작성되어 Black/Flake8 대비 10~100배 빠름 |
| 올인원 | Linter + Formatter + import 정리를 하나로 통합 |
| 800+ 규칙 | Flake8 플러그인 대부분을 내장 |
| 자동 수정 | --fix 옵션으로 자동 오류 수정 |
| 캐싱 | 변경되지 않은 파일은 재분석하지 않음 |
도구 대체 관계
Black → ruff format
isort → ruff check --select I
Flake8 → ruff check
pyupgrade → ruff check --select UP
autoflake → ruff check --select F401,F841
2. VSCode Extensions
필수 Extensions
| Extension | ID | 용도 |
|---|---|---|
| Python | ms-python.python | Python 기본 지원 |
| Pylance | ms-python.vscode-pylance | 타입 체킹, IntelliSense |
| Ruff | charliermarsh.ruff | Linter + Formatter |
| Jupyter | ms-toolsai.jupyter | 노트북 지원 |
Git & 협업
| Extension | ID | 용도 |
|---|---|---|
| GitLens | eamodio.gitlens | Git 히스토리, blame |
| Git Graph | mhutchie.git-graph | 브랜치 시각화 |
인프라 & DevOps
| Extension | ID | 용도 |
|---|---|---|
| YAML | redhat.vscode-yaml | YAML 스키마 지원 (k8s, Kubeflow) |
| Docker | ms-azuretools.vscode-docker | Docker 관리 |
| Remote - SSH | ms-vscode-remote.remote-ssh | 원격 서버 개발 |
생산성
| Extension | ID | 용도 |
|---|---|---|
| Error Lens | usernamehw.errorlens | 에러 인라인 표시 |
| Prettier | esbenp.prettier-vscode | JSON/Markdown 포맷팅 |
| Material Icon Theme | PKief.material-icon-theme | 파일 아이콘 |
| Thunder Client | rangav.vscode-thunder-client | API 테스트 |
설치 명령어 (CLI)
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension charliermarsh.ruff
code --install-extension ms-toolsai.jupyter
code --install-extension eamodio.gitlens
code --install-extension mhutchie.git-graph
code --install-extension redhat.vscode-yaml
code --install-extension ms-azuretools.vscode-docker
code --install-extension usernamehw.errorlens
code --install-extension esbenp.prettier-vscode
code --install-extension PKief.material-icon-theme
3. settings.json 전체 설정
Cmd + Shift + P → Preferences: Open User Settings (JSON)
{
// ===== 에디터 기본 =====
"editor.fontSize": 16,
"editor.fontVariations": false,
"editor.autoClosingBrackets": "never",
"editor.autoClosingQuotes": "never",
"editor.inlineSuggest.enabled": true,
"editor.parameterHints.enabled": true,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
"editor.quickSuggestionsDelay": 10,
"editor.suggestOnTriggerCharacters": true,
"editor.suggest.localityBonus": true,
"editor.wordBasedSuggestions": "matchingDocuments",
"editor.acceptSuggestionOnCommitCharacter": true,
"editor.acceptSuggestionOnEnter": "on",
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.stickyScroll.enabled": true,
"editor.minimap.enabled": false,
"editor.renderWhitespace": "boundary",
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
// ===== 파일 =====
"files.autoSave": "afterDelay",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true,
"**/*.pyc": true,
"**/.ipynb_checkpoints": true,
"**/.DS_Store": true,
"**/.ruff_cache": true
},
// ===== 검색 제외 =====
"search.exclude": {
"**/node_modules": true,
"**/__pycache__": true,
"**/.git": true,
"**/venv": true,
"**/.venv": true,
"**/dist": true,
"**/*.egg-info": true,
"**/.ruff_cache": true
},
// ===== 탐색기 =====
"explorer.confirmDelete": false,
"explorer.compactFolders": false,
"explorer.confirmDragAndDrop": false,
"explorer.confirmPasteNative": false,
// ===== 워크벤치 =====
"workbench.startupEditor": "none",
"breadcrumbs.enabled": false,
// ===== 보안 =====
"security.workspace.trust.untrustedFiles": "open",
// ===== 터미널 =====
"terminal.integrated.fontSize": 20,
"terminal.integrated.inheritEnv": false,
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.scrollback": 10000,
"terminal.integrated.enableMultiLinePasteWarning": "never",
// ===== Git =====
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
// ===== Python + Ruff =====
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.variableTypes": false,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
},
// ===== Jupyter =====
"jupyter.themeMatplotlibPlots": true,
"jupyter.askForKernelRestart": false,
"jupyter.widgetScriptSources": [
"jsdelivr.com",
"unpkg.com"
],
"notebook.output.wordWrap": true,
"notebook.formatOnSave.enabled": true,
"notebook.output.scrolling": true,
"notebook.lineNumbers": "on",
// ===== YAML =====
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.tabSize": 2,
"editor.autoIndent": "advanced"
},
"yaml.schemas": {
"kubernetes": "/*.yaml"
},
// ===== JSON =====
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// ===== Markdown =====
"markdown.preview.fontSize": 20,
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"comments": "off",
"strings": "off",
"other": "off"
},
"files.trimTrailingWhitespace": false
},
// ===== CSS =====
"css.lint.emptyRules": "ignore",
// ===== SCM =====
"scm.inputFontSize": 20,
// ===== 디버깅 =====
"debug.console.fontSize": 16,
"debug.internalConsoleOptions": "neverOpen",
// ===== Copilot (선택) =====
"github.copilot.enable": {
"*": true,
"yaml": true,
"markdown": true,
"plaintext": false
}
}
