[Easy][BE] update recommanded VS Code settings (#152760)

Changes:

- Remove old invalid settings and replace with new settings.
- Add commonly used VS Code extensions to support `cmake`, `ruff`, `mypy`, `flake8`, `editorconfig`, and spell checker. Also, add corresponding settings.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152760
Approved by: https://github.com/drisspg
This commit is contained in:
Xuehai Pan
2025-06-13 19:05:36 +08:00
committed by PyTorch MergeBot
parent 1393f71e07
commit e7da21806f
2 changed files with 53 additions and 9 deletions

View File

@ -1,5 +1,11 @@
{
"recommendations": [
"ms-python.python",
"charliermarsh.ruff",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-vscode.cmake-tools",
"EditorConfig.EditorConfig",
"streetsidesoftware.code-spell-checker",
]
}

View File

@ -1,15 +1,53 @@
{
"[python]": {
"editor.tabSize": 4
},
"files.associations": {
".clang-format": "yaml",
".clang-tidy": "yaml",
".flake8": "ini",
".coveragerc": "ini",
"*.py.in": "python",
"*.pyi.in": "python"
"*.pyi.in": "python",
"*requirements*.txt": "pip-requirements",
"*requirements*.in": "pip-requirements",
"*.cpp.in": "cpp",
"*.h.in": "cpp",
"*.cmake.in": "cmake",
"Makefile.*": "makefile",
"*.Makefile": "makefile",
"BUCK": "starlark",
"BUCK.*": "starlark"
},
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true
"cmake.preferredGenerators": [
"Ninja",
"Unix Makefiles"
],
"cmake.configureEnvironment": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"cmake.sourceDirectory": "${workspaceFolder}",
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.configureArgs": [
"-DPython_EXECUTABLE=${workspaceFolder}/venv/bin/python",
"-DPython_ROOT_DIR=${workspaceFolder}/venv"
],
"[python]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.defaultInterpreterPath": "${workspaceFolder}/venv/bin/python",
"python.analysis.inlayHints.functionReturnTypes": true,
"flake8.importStrategy": "fromEnvironment",
"flake8.args": [
"--append-config=${workspaceFolder}/.flake8"
],
"ruff.importStrategy": "fromEnvironment",
"ruff.lineLength": 88,
"ruff.organizeImports": false,
"ruff.configurationPreference": "filesystemFirst",
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.preferDaemon": true,
"mypy-type-checker.reportingScope": "workspace"
}