From bd3c527414a658c7f2f5591e10a61ca5980ac955 Mon Sep 17 00:00:00 2001 From: Jun Luo <4catcode@gmail.com> Date: Tue, 21 Nov 2023 12:00:07 +0800 Subject: [PATCH] Add VSCode Dev Container related configuration. (#184) --- .devcontainer/devcontainer.json | 14 ++++++++++++++ .vscode/tasks.json | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..78fbbb6c4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ruby +{ + "name": "Ruby", + "image": "mcr.microsoft.com/devcontainers/ruby:1-3.2-bookworm", + "customizations": { + "vscode": { + "extensions": [ + "Shopify.ruby-extensions-pack" + ] + } + }, + "postCreateCommand": "bundle install" +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..13c17cb88 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Run tests", + "type": "shell", + "command": "if [[ -n $(git status -s) ]]; then echo \"Error: There are uncommitted files, please commit or discard the changes before executing this command.\"; exit 1; fi && rm -fr spec/output && bundle exec rspec && git add spec/output && git status && git diff --staged --exit-code -- spec/output || (echo \"Test outputs contain changes.\" && exit 1)", + "group": "test", + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} \ No newline at end of file