mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
136 lines
4.9 KiB
JSON
136 lines
4.9 KiB
JSON
/*
|
|
* Copy this file as `.vscode/settings.json` to configure VSCode for this workspace.
|
|
* Unfortunately, VSCode doesn't (yet) offer any way to have "workspace defaults" or "user-worspace settings",
|
|
* so offering defaults to copy is the best we can do at the moment.
|
|
*
|
|
* ⚠ Disclaimer: The typeshed team doesn't commit to maintaining this file. It exists purely for your ease of use.
|
|
*/
|
|
{
|
|
// Don't format on save for formatters we don't explicitely control
|
|
"editor.formatOnSave": false,
|
|
"editor.codeActionsOnSave": {
|
|
"source.fixAll": false
|
|
},
|
|
// Set file associations to support comments syntax highlight
|
|
"files.associations": {
|
|
"settings.default.json": "jsonc",
|
|
"pyrightconfig*.json": "jsonc",
|
|
".flake8": "properties",
|
|
"stubtest_allowlist*.txt": "properties",
|
|
"**/stubtest_allowlists/*.txt": "properties",
|
|
"pytype_exclude_list.txt": "properties"
|
|
},
|
|
"files.exclude": {
|
|
"**/.*_cache": true, // mypy and Ruff cache
|
|
"**/__pycache__": true
|
|
},
|
|
"files.insertFinalNewline": true,
|
|
"files.trimFinalNewlines": true,
|
|
"files.trimTrailingWhitespace": true,
|
|
"editor.comments.insertSpace": true,
|
|
"editor.insertSpaces": true,
|
|
"editor.detectIndentation": false,
|
|
"editor.tabSize": 2,
|
|
"[json][jsonc][python]": {
|
|
"editor.tabSize": 4
|
|
},
|
|
"editor.rulers": [
|
|
90,
|
|
130
|
|
],
|
|
"[git-commit]": {
|
|
"editor.rulers": [
|
|
72
|
|
]
|
|
},
|
|
// Format on save for formatters we explicitely control
|
|
"[json][jsonc][yaml][python][toml]": {
|
|
"editor.formatOnSave": true,
|
|
"editor.codeActionsOnSave": {
|
|
"source.fixAll": true,
|
|
// Allow isort or Ruff to organize imports
|
|
"source.organizeImports": true
|
|
}
|
|
},
|
|
"[json][jsonc]": {
|
|
"editor.defaultFormatter": "vscode.json-language-features"
|
|
},
|
|
"[yaml]": {
|
|
"editor.defaultFormatter": "redhat.vscode-yaml"
|
|
},
|
|
"[toml]": {
|
|
"editor.rulers": [
|
|
90
|
|
],
|
|
"editor.defaultFormatter": "tamasfe.even-better-toml"
|
|
},
|
|
"[python]": {
|
|
"editor.rulers": [
|
|
130
|
|
],
|
|
"editor.defaultFormatter": "ms-python.black-formatter"
|
|
},
|
|
// Use the new dedicated extensions instead
|
|
"python.formatting.provider": "none",
|
|
"python.linting.enabled": false,
|
|
"python.linting.mypyEnabled": false,
|
|
"python.linting.flake8Enabled": false,
|
|
"python.linting.pycodestyleEnabled": false,
|
|
"python.linting.prospectorEnabled": false,
|
|
"python.linting.pylamaEnabled": false,
|
|
"python.linting.pylintEnabled": false,
|
|
// Not using bandit
|
|
"python.linting.banditEnabled": false,
|
|
// python.analysis is Pylance (pyright) configurations
|
|
"python.analysis.fixAll": [
|
|
"source.unusedImports"
|
|
// Explicitly omiting "source.convertImportFormat", some stubs use relative imports
|
|
],
|
|
// Important to use `types-*` and flag untyped dependencies.
|
|
"python.analysis.useLibraryCodeForTypes": false,
|
|
"python.analysis.typeshedPaths": [
|
|
"${workspaceFolder}"
|
|
],
|
|
"python.analysis.extraPaths": [
|
|
"tests"
|
|
],
|
|
"mypy-type-checker.importStrategy": "fromEnvironment",
|
|
"mypy-type-checker.args": [
|
|
"--custom-typeshed-dir=${workspaceFolder}",
|
|
"--python-version=3.7",
|
|
"--strict"
|
|
// Needed because a library stubbed in typeshed won't necessarily be installed inthe dev's environment
|
|
// Currentyl broken in dmypy: https://github.com/python/mypy/issues/10709
|
|
// "--ignore-missing-imports"
|
|
],
|
|
// Ensure typeshed's configs are used, and not user's VSCode settings
|
|
"flake8.args": [
|
|
"--config=.flake8"
|
|
],
|
|
"flake8.importStrategy": "fromEnvironment",
|
|
"isort.check": true,
|
|
"isort.importStrategy": "fromEnvironment",
|
|
"black-formatter.importStrategy": "fromEnvironment",
|
|
"ruff.importStrategy": "fromEnvironment",
|
|
"ruff.fixAll": true,
|
|
// Conflict between Ruff and isort
|
|
"ruff.organizeImports": false,
|
|
"evenBetterToml.formatter.alignComments": false,
|
|
"evenBetterToml.formatter.alignEntries": false,
|
|
"evenBetterToml.formatter.allowedBlankLines": 1,
|
|
"evenBetterToml.formatter.arrayAutoCollapse": true,
|
|
"evenBetterToml.formatter.arrayAutoExpand": true,
|
|
"evenBetterToml.formatter.arrayTrailingComma": true,
|
|
"evenBetterToml.formatter.columnWidth": 90,
|
|
"evenBetterToml.formatter.compactArrays": true,
|
|
"evenBetterToml.formatter.compactEntries": false,
|
|
"evenBetterToml.formatter.compactInlineTables": false,
|
|
"evenBetterToml.formatter.indentEntries": false,
|
|
"evenBetterToml.formatter.indentTables": false,
|
|
"evenBetterToml.formatter.inlineTableExpand": false,
|
|
"evenBetterToml.formatter.reorderArrays": true,
|
|
"evenBetterToml.formatter.trailingNewline": true,
|
|
// We like keeping TOML keys in a certain non-alphabetical order that feels more natural
|
|
"evenBetterToml.formatter.reorderKeys": false
|
|
}
|