diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ba22488f212..b59eef2410e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -33,7 +33,7 @@ "GitHub.vscode-pull-request-github", "GitHub.copilot" ], - // Please keep this file in sync with settings in home-assistant/.vscode/settings.default.json + // Please keep this file in sync with settings in home-assistant/.vscode/settings.default.jsonc "settings": { "python.experiments.optOutFrom": ["pythonTestAdapter"], "python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python", @@ -63,6 +63,9 @@ "[python]": { "editor.defaultFormatter": "charliermarsh.ruff" }, + "[json][jsonc][yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "json.schemas": [ { "fileMatch": ["homeassistant/components/*/manifest.json"], diff --git a/.gitignore b/.gitignore index a8bafbc343e..81f32c69eda 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,7 @@ virtualization/vagrant/config !.vscode/cSpell.json !.vscode/extensions.json !.vscode/tasks.json +!.vscode/settings.default.jsonc .env # Windows Explorer diff --git a/.vscode/settings.default.json b/.vscode/settings.default.jsonc similarity index 60% rename from .vscode/settings.default.json rename to .vscode/settings.default.jsonc index 1fae0e55912..3d04c152a49 100644 --- a/.vscode/settings.default.json +++ b/.vscode/settings.default.jsonc @@ -9,13 +9,17 @@ "pylint.importStrategy": "fromEnvironment", // Pyright is too pedantic for Home Assistant "python.analysis.typeCheckingMode": "basic", + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff" + }, + "[json][jsonc][yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "json.schemas": [ - { - "fileMatch": [ - "homeassistant/components/*/manifest.json" - ], - // This value differs between working with devcontainer and locally, therefor this value should NOT be in sync! - "url": "./script/json_schemas/manifest_schema.json" - } - ] + { + "fileMatch": ["homeassistant/components/*/manifest.json"], + // This value differs between working with devcontainer and locally, therefore this value should NOT be in sync! + "url": "./script/json_schemas/manifest_schema.json" + } + ] } diff --git a/script/setup b/script/setup index 00600b3c1ac..1fd61aa9b71 100755 --- a/script/setup +++ b/script/setup @@ -8,7 +8,7 @@ cd "$(dirname "$0")/.." # Add default vscode settings if not existing SETTINGS_FILE=./.vscode/settings.json -SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.json +SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.jsonc if [ ! -f "$SETTINGS_FILE" ]; then echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE." cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"