VSCode / devcontainer updates (#4647)

This commit is contained in:
Jesse Hills 2023-04-04 07:44:46 +12:00 committed by GitHub
parent d78e9e6aa8
commit 99638190cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 45 deletions

View file

@ -4,53 +4,60 @@
"postCreateCommand": [ "postCreateCommand": [
"script/devcontainer-post-create" "script/devcontainer-post-create"
], ],
"containerEnv": {
"DEVCONTAINER": "1"
},
"runArgs": [ "runArgs": [
"--privileged", "--privileged",
"-e", "-e",
"ESPHOME_DASHBOARD_USE_PING=1" "ESPHOME_DASHBOARD_USE_PING=1"
], ],
"appPort": 6052, "appPort": 6052,
"extensions": [ "customizations": {
// python "vscode": {
"ms-python.python", "extensions": [
"visualstudioexptteam.vscodeintellicode", // python
// yaml "ms-python.python",
"redhat.vscode-yaml", "visualstudioexptteam.vscodeintellicode",
// cpp // yaml
"ms-vscode.cpptools", "redhat.vscode-yaml",
// editorconfig // cpp
"editorconfig.editorconfig", "ms-vscode.cpptools",
], // editorconfig
"settings": { "editorconfig.editorconfig",
"python.languageServer": "Pylance", ],
"python.pythonPath": "/usr/bin/python3", "settings": {
"python.linting.pylintEnabled": true, "python.languageServer": "Pylance",
"python.linting.enabled": true, "python.pythonPath": "/usr/bin/python3",
"python.formatting.provider": "black", "python.linting.pylintEnabled": true,
"editor.formatOnPaste": false, "python.linting.enabled": true,
"editor.formatOnSave": true, "python.formatting.provider": "black",
"editor.formatOnType": true, "editor.formatOnPaste": false,
"files.trimTrailingWhitespace": true, "editor.formatOnSave": true,
"terminal.integrated.defaultProfile.linux": "bash", "editor.formatOnType": true,
"yaml.customTags": [ "files.trimTrailingWhitespace": true,
"!secret scalar", "terminal.integrated.defaultProfile.linux": "bash",
"!lambda scalar", "yaml.customTags": [
"!include_dir_named scalar", "!secret scalar",
"!include_dir_list scalar", "!lambda scalar",
"!include_dir_merge_list scalar", "!include_dir_named scalar",
"!include_dir_merge_named scalar" "!include_dir_list scalar",
], "!include_dir_merge_list scalar",
"files.exclude": { "!include_dir_merge_named scalar"
"**/.git": true, ],
"**/.DS_Store": true, "files.exclude": {
"**/*.pyc": { "**/.git": true,
"when": "$(basename).py" "**/.DS_Store": true,
}, "**/*.pyc": {
"**/__pycache__": true "when": "$(basename).py"
}, },
"files.associations": { "**/__pycache__": true
"**/.vscode/*.json": "jsonc" },
}, "files.associations": {
"C_Cpp.clang_format_path": "/usr/bin/clang-format-13", "**/.vscode/*.json": "jsonc"
},
"C_Cpp.clang_format_path": "/usr/bin/clang-format-13"
}
}
} }
} }

15
.vscode/tasks.json vendored
View file

@ -2,15 +2,24 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "run", "label": "Run Dashboard",
"type": "shell", "type": "shell",
"command": "python3 -m esphome dashboard config/", "command": "${command:python.interpreterPath}",
"args": [
"-m",
"esphome",
"dashboard",
"config/"
],
"problemMatcher": [] "problemMatcher": []
}, },
{ {
"label": "clang-tidy", "label": "clang-tidy",
"type": "shell", "type": "shell",
"command": "./script/clang-tidy", "command": "${command:python.interpreterPath}",
"args": [
"./script/clang-tidy"
],
"problemMatcher": [ "problemMatcher": [
{ {
"owner": "clang-tidy", "owner": "clang-tidy",

View file

@ -4,6 +4,12 @@
set -e set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ]; then
python3 -m venv venv
source venv/bin/activate
fi
pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
pip3 install --no-use-pep517 -e . pip3 install --no-use-pep517 -e .