diff --git a/.devcontainer/devcontainer-extensions.json b/.devcontainer/devcontainer-extensions.json new file mode 100644 index 0000000..118f45c --- /dev/null +++ b/.devcontainer/devcontainer-extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [], + "unwantedRecommendations": [ + "ms-python.pylint" + ] +} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 87f3784..3f971d8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,9 @@ "containerEnv": { "PYTHONASYNCIODEBUG": "1" }, - "forwardPorts": [8123], + "forwardPorts": [ + 8123 + ], "portsAttributes": { "8123": { "label": "Home Assistant", @@ -16,30 +18,42 @@ "vscode": { "extensions": [ "charliermarsh.ruff", - "github.vscode-pull-request-github", - "ms-python.python", - "ms-python.pylint", - "ms-python.vscode-pylance", - "ryanluker.vscode-coverage-gutters", - "visualstudioexptteam.vscodeintellicode", - "redhat.vscode-yaml", + "EditorConfig.EditorConfig", "esbenp.prettier-vscode", "github.copilot", - "ms-vscode-remote.remote-containers" + "github.vscode-pull-request-github", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-vscode-remote.remote-containers", + "redhat.vscode-yaml", + "ryanluker.vscode-coverage-gutters", + "visualstudioexptteam.vscodeintellicode" ], "settings": { "editor.tabSize": 4, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": false, + "extensions.ignoreRecommendations": false, "files.eol": "\n", "files.trimTrailingWhitespace": true, "python.analysis.typeCheckingMode": "basic", "python.analysis.autoImportCompletions": true, "python.defaultInterpreterPath": "/usr/local/bin/python", - "pylint.importStrategy": "fromEnvironment", + "python.linting.enabled": true, + "python.linting.ruffEnabled": true, "python.terminal.activateEnvInCurrentTerminal": true, - "python.testing.pytestArgs": ["--no-cov"], + "python.testing.pytestArgs": [ + "--no-cov" + ], + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.fixAll.ruff": "explicit" + } + }, "yaml.customTags": [ "!input scalar", "!secret scalar", @@ -48,16 +62,17 @@ "!include_dir_merge_list scalar", "!include_dir_merge_named scalar" ], - "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff" - }, "json.schemas": [ { - "fileMatch": ["homeassistant/components/*/manifest.json"], + "fileMatch": [ + "homeassistant/components/*/manifest.json" + ], "url": "${containerWorkspaceFolder}/scripts/json_schemas/manifest_schema.json" }, { - "fileMatch": ["homeassistant/components/*/translations/*.json"], + "fileMatch": [ + "homeassistant/components/*/translations/*.json" + ], "url": "${containerWorkspaceFolder}/scripts/json_schemas/translation_schema.json" } ] @@ -68,7 +83,11 @@ "features": { "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers-extra/features/apt-packages:1": { - "packages": ["ffmpeg", "libturbojpeg0", "libpcap-dev"] + "packages": [ + "ffmpeg", + "libturbojpeg0", + "libpcap-dev" + ] } } -} +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e393554 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.py] +# Python style aligns with Black +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..dd50e39 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,16 @@ +# Ignore Python files – handled by Ruff/Black +*.py +*.pyi + +# Ignore Home Assistant compiled files +__pycache__/ +*.pyc + +# Ignore virtual environments or dependencies +.venv/ +env/ +venv/ + +# Ignore compiled YAML or generated docs +*.yaml +*.yml