Improve VS Code Python settings (#2860)

chore: Fix deprecated vscode Python formatter

The python.formatting.provider setting was deprecated in favor of
having a separate extension for each Python formatter and using
editor.defaultFormatter instead. This adds a recommendation for the
Black formatter extension and selects it for Python files.

chore: Limit vscode Python analysis paths

This limits vscode's Python analysis to the scripts folders so it
doesn't slow down trying to scan all of Zephyr.
This commit is contained in:
Joel Spadin 2025-04-20 03:34:15 -05:00 committed by GitHub
parent 2c0e7daced
commit 2a7ab8ed0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"ms-python.black-formatter",
"ms-python.python",
"ms-vscode.cpptools",
"plorefice.devicetree",

View File

@ -3,7 +3,7 @@
"*.overlay": "dts",
"*.keymap": "dts"
},
"python.formatting.provider": "black",
"python.analysis.include": ["app/scripts", "zephyr/scripts"],
"[c]": {
"editor.formatOnSave": true
},
@ -13,7 +13,7 @@
},
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.python"
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[css][json][jsonc][html][markdown][yaml]": {
"editor.formatOnSave": true,