From 3d3e801122af3cf24612be45c09f0c2b296ee517 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Jun 2019 14:29:09 +0200 Subject: [PATCH] Adds support for VS Code Remote Development (#9726) * Adds support for VS Code Remote Development * Adds support for VS Code Remote Development --- .devcontainer/Dockerfile | 33 +++++++++++++ .devcontainer/devcontainer.json | 30 ++++++++++++ .gitignore | 5 +- .vscode/cSpell.json | 83 +++++++++++++++++++++++++++++++++ .vscode/extensions.json | 8 ++++ .vscode/tasks.json | 23 +++++++++ 6 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/cSpell.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000000..a981cd420fc0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,33 @@ +FROM ruby:2.6 + +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# Use Bash as the default shell +ENV SHELL=/bin/bash + +# Locale env vars +ENV \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ + LC_ALL=en_US.UTF-8 + +# Install git, process tools +RUN apt update \ + && apt-get install -y --no-install-recommends \ + ack \ + git \ + locales \ + procps \ + && echo "en_US UTF-8" > /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && echo 'export PS1="\\w\$ "' > /root/.bashrc \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Install the specific version of bundler we need +RUN gem install bundler -v 2.0.1 + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..399a22a2be64 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "name": "home-assistant.io", + "dockerFile": "Dockerfile", + "appPort": [ + 4000 + ], + "postCreateCommand": "bundle install", + "extensions": [ + "davidanson.vscode-markdownlint", + "eamodio.gitlens", + "editorconfig.editorconfig", + "github.vscode-pull-request-github", + "mrmlnc.vscode-scss", + "ms-vsliveshare.vsliveshare", + "rebornix.Ruby", + "streetsidesoftware.code-spell-checker", + "yzhang.markdown-all-in-one" + ], + "settings": { + "editor.rulers": [80, 100, 120], + "editor.renderWhitespace": "boundary", + "errorLens.gutterIconsEnabled": true, + "errorLens.addAnnotationTextPrefixes": false, + "errorLens.enabledDiagnosticLevels": [ + "error", + "warning" + ], + "terminal.integrated.shell.linux": "/bin/bash" + } +} diff --git a/.gitignore b/.gitignore index 933ece07209b..7578554e2959 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,8 @@ source/.jekyll-metadata /.vs/config/applicationhost.config /.vs/slnx.sqlite-journal /.vs/VSWorkspaceState.json -.vscode +.vscode/* +!.vscode/cSpell.json +!.vscode/extensions.json +!.vscode/tasks.json *.suo diff --git a/.vscode/cSpell.json b/.vscode/cSpell.json new file mode 100644 index 000000000000..42c5d088e2fc --- /dev/null +++ b/.vscode/cSpell.json @@ -0,0 +1,83 @@ +// cSpell Settings +// Contains additional words for our project +{ + "version": "0.1", + "language": "en", + "words": [ + "arest", + "automations", + "bloomsky", + "bluesound", + "BTLE", + "Denon", + "endconfiguration", + "endraw", + "fitbit", + "Flexit", + "geizhals", + "Harman", + "hass", + "hass.io", + "hassos", + "hcitool", + "heos", + "hikvision", + "Homematic", + "IBAN", + "icloud", + "kardon", + "macos", + "Modbus", + "Mosquitto", + "nginx", + "ohmconnect", + "Onkyo", + "paulus", + "templating", + "waqi", + "Webhook" + ], + // flagWords - list of words to be always considered incorrect + // This is useful for offensive words and common spelling errors. + // For example "hte" should be "the" + "flagWords": [ + "hte", + "asssistant" + ], + "enabledLanguageIds": [ + "asciidoc", + "c", + "cpp", + "csharp", + "css", + "dockerfile", + "gemfile", + "git-commit", + "go", + "handlebars", + "html", + "jade", + "java", + "javascript", + "javascriptreact", + "json", + "jsonc", + "latex", + "less", + "liquid", + "markdown", + "php", + "plaintext", + "pug", + "python", + "restructuredtext", + "rust", + "scala", + "scss", + "text", + "typescript", + "typescriptreact", + "yaml", + "yml" + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000000..5f55e50474fe --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "davidanson.vscode-markdownlint", + "editorconfig.editorconfig", + "streetsidesoftware.code-spell-checker", + "yzhang.markdown-all-in-one" + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000000..7a872b87d919 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Generate", + "type": "shell", + "command": "bundle exec rake generate", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Preview", + "type": "shell", + "command": "bundle exec rake preview", + "group": { + "kind": "test", + "isDefault": true, + } + } + ] +} \ No newline at end of file