Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a376e7

Browse files
authored
Configure Ruff for VSCode (#10572)
1 parent 22b055a commit 3a376e7

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
"recommendations": [
55
"bierner.github-markdown-preview",
6+
"charliermarsh.ruff",
67
"editorconfig.editorconfig",
78
"ms-python.black-formatter",
89
"ms-python.flake8",
@@ -30,8 +31,6 @@
3031
"ms-python.autopep8",
3132
// Not using pylint
3233
"ms-python.pylint",
33-
// Not using Ruff
34-
"charliermarsh.ruff",
3534
// VSCode has implemented an optimized version
3635
"coenraads.bracket-pair-colorizer",
3736
"coenraads.bracket-pair-colorizer-2",

.vscode/settings.default.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
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
98
{
109
// Don't format on save for formatters we don't explicitely control
1110
"editor.formatOnSave": false,
@@ -22,7 +21,8 @@
2221
"pytype_exclude_list.txt": "properties"
2322
},
2423
"files.exclude": {
25-
"**/.mypy_cache": true
24+
"**/.*_cache": true, // mypy and Ruff cache
25+
"**/__pycache__": true
2626
},
2727
"files.insertFinalNewline": true,
2828
"files.trimFinalNewlines": true,
@@ -48,6 +48,7 @@
4848
"editor.formatOnSave": true,
4949
"editor.codeActionsOnSave": {
5050
"source.fixAll": true,
51+
// Allow isort or Ruff to organize imports
5152
"source.organizeImports": true
5253
}
5354
},
@@ -110,6 +111,10 @@
110111
"isort.check": true,
111112
"isort.importStrategy": "fromEnvironment",
112113
"black-formatter.importStrategy": "fromEnvironment",
114+
"ruff.importStrategy": "fromEnvironment",
115+
"ruff.fixAll": true,
116+
// Conflict between Ruff and isort
117+
"ruff.organizeImports": false,
113118
"evenBetterToml.formatter.alignComments": false,
114119
"evenBetterToml.formatter.alignEntries": false,
115120
"evenBetterToml.formatter.allowedBlankLines": 1,

0 commit comments

Comments
 (0)