Skip to content

Update vscode recommended settings #10314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 37 additions & 31 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
// ⚠ Disclaimer: The typeshed team doesn't commit to maintaining this file. It exists purely for your ease of use.

// Keep in alphabetical order
{
"recommendations": [
"bierner.github-markdown-preview",
"bungcip.better-toml",
"editorconfig.editorconfig",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
],
"unwantedRecommendations": [
/*
* Don't recommend by default for this workspace
*/
"christian-kohler.npm-intellisense",
/*
* Must disable in this workspace
* https://github.com/microsoft/vscode/issues/40239
*/
// We use black
"ms-python.autopep8",
// Not using pylint
"ms-python.pylint",
// VSCode has implemented an optimized version
"coenraads.bracket-pair-colorizer",
"coenraads.bracket-pair-colorizer-2",
// Obsoleted by Pylance
"ms-pyright.pyright",
],
"recommendations": [
Copy link
Collaborator Author

@Avasam Avasam Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of whitespace changes because apparently last time I didn't "format on save" this file. This respects the configuration in .editorconfig and .vscode/settings.json.

"bierner.github-markdown-preview",
"editorconfig.editorconfig",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
],
"unwantedRecommendations": [
/*
* Don't recommend by default for this workspace
*/
"christian-kohler.npm-intellisense",
/*
* Must disable in this workspace
* https://github.com/microsoft/vscode/issues/40239
*/
// even-better-toml has format on save
"bungcip.better-toml",
// Don't use two mypy extensions simultaneously
"matangover.mypy",
// We use black
"ms-python.autopep8",
// Not using pylint
"ms-python.pylint",
// Not using Ruff
"charliermarsh.ruff",
// VSCode has implemented an optimized version
"coenraads.bracket-pair-colorizer",
"coenraads.bracket-pair-colorizer-2",
// Obsoleted by Pylance
"ms-pyright.pyright",
],
}
108 changes: 72 additions & 36 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
* ⚠ Disclaimer: The typeshed team doesn't commit to maintaining this file. It exists purely for your ease of use.
*/
// TODO: Add charliermarsh.ruff to unrecommended extensions
{
// Don't format on save for formatters we don't explicitely control
"editor.formatOnSave": false,
Expand Down Expand Up @@ -33,62 +34,97 @@
"[json][jsonc][python]": {
"editor.tabSize": 4
},
"[markdown]": {
"editor.rulers": [
90,
130
]
},
"editor.rulers": [
90,
130
],
"[git-commit]": {
"editor.rulers": [
72
]
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml",
// Format on save for formatters we explicitely control
"[json][jsonc][yaml][python][toml]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": true,
"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.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [
130
],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.unusedImports": true,
"source.fixAll.convertImportFormat": true,
"source.organizeImports": true
}
"editor.defaultFormatter": "ms-python.black-formatter"
},
"isort.check": true,
// Using the dedicated black extension
"black-formatter.importStrategy": "fromEnvironment",
// Use the new dedicated extensions instead
"python.formatting.provider": "none",
// Important to follow the config in pyrightconfig.json
"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"
],
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.mypyArgs": [
"--show-column-numbers",
"--no-pretty",
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.args": [
"--custom-typeshed-dir=${workspaceFolder}",
"--python-version=3.7"
"--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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging python/mypy#10709 for reference

// "--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",
// Not using bandit
"python.linting.banditEnabled": false,
// Using dedicated Flake8 extension
"python.linting.flake8Enabled": false,
"python.linting.pycodestyleEnabled": false,
"python.linting.prospectorEnabled": false,
"python.linting.pylamaEnabled": false,
// Use the new dedicated extensions instead (and we're not using pylint)
"python.linting.pylintEnabled": false
"black-formatter.importStrategy": "fromEnvironment",
"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
}