Skip to content

Commit d622a27

Browse files
authored
Update vscode recommended settings (#10314)
1 parent ce222e5 commit d622a27

File tree

2 files changed

+109
-67
lines changed

2 files changed

+109
-67
lines changed

.vscode/extensions.json

+37-31
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
// ⚠ Disclaimer: The typeshed team doesn't commit to maintaining this file. It exists purely for your ease of use.
2-
32
// Keep in alphabetical order
43
{
5-
"recommendations": [
6-
"bierner.github-markdown-preview",
7-
"bungcip.better-toml",
8-
"editorconfig.editorconfig",
9-
"ms-python.black-formatter",
10-
"ms-python.flake8",
11-
"ms-python.isort",
12-
"ms-python.python",
13-
"ms-python.vscode-pylance",
14-
"redhat.vscode-yaml",
15-
],
16-
"unwantedRecommendations": [
17-
/*
18-
* Don't recommend by default for this workspace
19-
*/
20-
"christian-kohler.npm-intellisense",
21-
/*
22-
* Must disable in this workspace
23-
* https://github.com/microsoft/vscode/issues/40239
24-
*/
25-
// We use black
26-
"ms-python.autopep8",
27-
// Not using pylint
28-
"ms-python.pylint",
29-
// VSCode has implemented an optimized version
30-
"coenraads.bracket-pair-colorizer",
31-
"coenraads.bracket-pair-colorizer-2",
32-
// Obsoleted by Pylance
33-
"ms-pyright.pyright",
34-
],
4+
"recommendations": [
5+
"bierner.github-markdown-preview",
6+
"editorconfig.editorconfig",
7+
"ms-python.black-formatter",
8+
"ms-python.flake8",
9+
"ms-python.isort",
10+
"ms-python.mypy-type-checker",
11+
"ms-python.python",
12+
"ms-python.vscode-pylance",
13+
"tamasfe.even-better-toml",
14+
"redhat.vscode-yaml",
15+
],
16+
"unwantedRecommendations": [
17+
/*
18+
* Don't recommend by default for this workspace
19+
*/
20+
"christian-kohler.npm-intellisense",
21+
/*
22+
* Must disable in this workspace
23+
* https://github.com/microsoft/vscode/issues/40239
24+
*/
25+
// even-better-toml has format on save
26+
"bungcip.better-toml",
27+
// Don't use two mypy extensions simultaneously
28+
"matangover.mypy",
29+
// We use black
30+
"ms-python.autopep8",
31+
// Not using pylint
32+
"ms-python.pylint",
33+
// Not using Ruff
34+
"charliermarsh.ruff",
35+
// VSCode has implemented an optimized version
36+
"coenraads.bracket-pair-colorizer",
37+
"coenraads.bracket-pair-colorizer-2",
38+
// Obsoleted by Pylance
39+
"ms-pyright.pyright",
40+
],
3541
}

.vscode/settings.default.json

+72-36
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* ⚠ Disclaimer: The typeshed team doesn't commit to maintaining this file. It exists purely for your ease of use.
77
*/
8+
// TODO: Add charliermarsh.ruff to unrecommended extensions
89
{
910
// Don't format on save for formatters we don't explicitely control
1011
"editor.formatOnSave": false,
@@ -33,62 +34,97 @@
3334
"[json][jsonc][python]": {
3435
"editor.tabSize": 4
3536
},
36-
"[markdown]": {
37-
"editor.rulers": [
38-
90,
39-
130
40-
]
41-
},
37+
"editor.rulers": [
38+
90,
39+
130
40+
],
4241
"[git-commit]": {
4342
"editor.rulers": [
4443
72
4544
]
4645
},
47-
"[yaml]": {
48-
"editor.defaultFormatter": "redhat.vscode-yaml",
46+
// Format on save for formatters we explicitely control
47+
"[json][jsonc][yaml][python][toml]": {
4948
"editor.formatOnSave": true,
5049
"editor.codeActionsOnSave": {
51-
"source.fixAll": true
50+
"source.fixAll": true,
51+
"source.organizeImports": true
5252
}
5353
},
54+
"[json][jsonc]": {
55+
"editor.defaultFormatter": "vscode.json-language-features"
56+
},
57+
"[yaml]": {
58+
"editor.defaultFormatter": "redhat.vscode-yaml"
59+
},
60+
"[toml]": {
61+
"editor.rulers": [
62+
90
63+
],
64+
"editor.defaultFormatter": "tamasfe.even-better-toml"
65+
},
5466
"[python]": {
55-
"editor.defaultFormatter": "ms-python.black-formatter",
5667
"editor.rulers": [
5768
130
5869
],
59-
"editor.formatOnSave": true,
60-
"editor.codeActionsOnSave": {
61-
"source.fixAll": true,
62-
"source.fixAll.unusedImports": true,
63-
"source.fixAll.convertImportFormat": true,
64-
"source.organizeImports": true
65-
}
70+
"editor.defaultFormatter": "ms-python.black-formatter"
6671
},
67-
"isort.check": true,
68-
// Using the dedicated black extension
69-
"black-formatter.importStrategy": "fromEnvironment",
72+
// Use the new dedicated extensions instead
7073
"python.formatting.provider": "none",
71-
// Important to follow the config in pyrightconfig.json
74+
"python.linting.enabled": false,
75+
"python.linting.mypyEnabled": false,
76+
"python.linting.flake8Enabled": false,
77+
"python.linting.pycodestyleEnabled": false,
78+
"python.linting.prospectorEnabled": false,
79+
"python.linting.pylamaEnabled": false,
80+
"python.linting.pylintEnabled": false,
81+
// Not using bandit
82+
"python.linting.banditEnabled": false,
83+
// python.analysis is Pylance (pyright) configurations
84+
"python.analysis.fixAll": [
85+
"source.unusedImports"
86+
// Explicitly omiting "source.convertImportFormat", some stubs use relative imports
87+
],
88+
// Important to use `types-*` and flag untyped dependencies.
7289
"python.analysis.useLibraryCodeForTypes": false,
90+
"python.analysis.typeshedPaths": [
91+
"${workspaceFolder}"
92+
],
7393
"python.analysis.extraPaths": [
7494
"tests"
7595
],
76-
"python.linting.enabled": true,
77-
"python.linting.mypyEnabled": true,
78-
"python.linting.mypyArgs": [
79-
"--show-column-numbers",
80-
"--no-pretty",
96+
"mypy-type-checker.importStrategy": "fromEnvironment",
97+
"mypy-type-checker.args": [
8198
"--custom-typeshed-dir=${workspaceFolder}",
82-
"--python-version=3.7"
99+
"--python-version=3.7",
100+
"--strict"
101+
// Needed because a library stubbed in typeshed won't necessarily be installed inthe dev's environment
102+
// Currentyl broken in dmypy: https://github.com/python/mypy/issues/10709
103+
// "--ignore-missing-imports"
83104
],
105+
// Ensure typeshed's configs are used, and not user's VSCode settings
106+
"flake8.args": [
107+
"--config=.flake8"
108+
],
109+
"flake8.importStrategy": "fromEnvironment",
110+
"isort.check": true,
84111
"isort.importStrategy": "fromEnvironment",
85-
// Not using bandit
86-
"python.linting.banditEnabled": false,
87-
// Using dedicated Flake8 extension
88-
"python.linting.flake8Enabled": false,
89-
"python.linting.pycodestyleEnabled": false,
90-
"python.linting.prospectorEnabled": false,
91-
"python.linting.pylamaEnabled": false,
92-
// Use the new dedicated extensions instead (and we're not using pylint)
93-
"python.linting.pylintEnabled": false
112+
"black-formatter.importStrategy": "fromEnvironment",
113+
"evenBetterToml.formatter.alignComments": false,
114+
"evenBetterToml.formatter.alignEntries": false,
115+
"evenBetterToml.formatter.allowedBlankLines": 1,
116+
"evenBetterToml.formatter.arrayAutoCollapse": true,
117+
"evenBetterToml.formatter.arrayAutoExpand": true,
118+
"evenBetterToml.formatter.arrayTrailingComma": true,
119+
"evenBetterToml.formatter.columnWidth": 90,
120+
"evenBetterToml.formatter.compactArrays": true,
121+
"evenBetterToml.formatter.compactEntries": false,
122+
"evenBetterToml.formatter.compactInlineTables": false,
123+
"evenBetterToml.formatter.indentEntries": false,
124+
"evenBetterToml.formatter.indentTables": false,
125+
"evenBetterToml.formatter.inlineTableExpand": false,
126+
"evenBetterToml.formatter.reorderArrays": true,
127+
"evenBetterToml.formatter.trailingNewline": true,
128+
// We like keeping TOML keys in a certain non-alphabetical order that feels more natural
129+
"evenBetterToml.formatter.reorderKeys": false
94130
}

0 commit comments

Comments
 (0)