From a6f72d97bc7484508022ce9fefd7ea045eba4fae Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 7 Jun 2023 07:51:11 +0000 Subject: [PATCH] chore(dev): update devcontainer definitions --- .devcontainer/README.md | 1 - .devcontainer/devcontainer.json | 132 ++++++++++++++----------------- .devcontainer/docker-compose.yml | 8 +- 3 files changed, 62 insertions(+), 79 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 503813253..f14390ac6 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -22,7 +22,6 @@ It works on Linux, Windows and OSX. Note that the development container will create the empty directories `~/.docker`, `~/.ssh` and `~/.kube` if you don't have them. 1. **For Docker on OSX or Windows without WSL**: ensure your home directory `~` is accessible by Docker. -1. **For Docker on Windows without WSL:** if you want to use SSH keys, bind mount your host `~/.ssh` to `/tmp/.ssh` instead of `~/.ssh` by changing the `volumes` section in the [docker-compose.yml](docker-compose.yml). 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P). 1. Select `Remote-Containers: Open Folder in Container...` and choose the project directory. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6566f3280..08f3ec839 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,77 +11,65 @@ "postCreateCommand": "~/.windows.sh && go mod download && go mod tidy", "workspaceFolder": "/workspace", // "overrideCommand": "", - "extensions": [ - "golang.go", - "eamodio.gitlens", // IDE Git information - "davidanson.vscode-markdownlint", - "ms-azuretools.vscode-docker", // Docker integration and linting - "shardulm94.trailing-spaces", // Show trailing spaces - "Gruntfuggly.todo-tree", // Highlights TODO comments - "bierner.emojisense", // Emoji sense for markdown - "stkb.rewrap", // rewrap comments after n characters on one line - "vscode-icons-team.vscode-icons", // Better file extension icons - "github.vscode-pull-request-github", // Github interaction - "redhat.vscode-yaml", // Kubernetes, Drone syntax highlighting - "bajdzis.vscode-database", // Supports connections to mysql or postgres, over SSL, socked - "IBM.output-colorizer", // Colorize your output/test logs - // "mohsen1.prettify-json", // Prettify JSON data - // "zxh404.vscode-proto3", // Supports Proto syntax - // "jrebocho.vscode-random", // Generates random values - // "alefragnani.Bookmarks", // Manage bookmarks - // "quicktype.quicktype", // Paste JSON as code - // "spikespaz.vscode-smoothtype", // smooth cursor animation - ], - "settings": { - "files.eol": "\n", - "remote.extensionKind": { - "ms-azuretools.vscode-docker": "workspace" - }, - "editor.codeActionsOnSaveTimeout": 3000, - "go.useLanguageServer": true, - "[go]": { - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": true, - }, - // Optional: Disable snippets, as they conflict with completion ranking. - "editor.snippetSuggestions": "none" - }, - "[go.mod]": { - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": true, - }, - }, - "gopls": { - "usePlaceholders": false, - "staticcheck": true - }, - "go.autocompleteUnimportedPackages": true, - "go.gotoSymbol.includeImports": true, - "go.gotoSymbol.includeGoroot": true, - "go.lintTool": "golangci-lint", - "go.buildOnSave": "workspace", - "go.lintOnSave": "workspace", - "go.vetOnSave": "workspace", - "editor.formatOnSave": true, - "go.toolsEnvVars": { - "GOFLAGS": "-tags=", - "CGO_ENABLED": 1 // for the race detector - }, - "gopls.env": { - "GOFLAGS": "-tags=" - }, - "go.testEnvVars": { - "": "", - }, - "go.testFlags": [ - "-v", - "-race" - ], - "go.testTimeout": "10s", - "go.coverOnSingleTest": true, - "go.coverOnSingleTestFile": true, - "go.coverOnTestPackage": true + "customizations": { + "vscode": { + "extensions": [ + "golang.go", + "eamodio.gitlens", // IDE Git information + "davidanson.vscode-markdownlint", + "ms-azuretools.vscode-docker", // Docker integration and linting + "shardulm94.trailing-spaces", // Show trailing spaces + "Gruntfuggly.todo-tree", // Highlights TODO comments + "bierner.emojisense", // Emoji sense for markdown + "stkb.rewrap", // rewrap comments after n characters on one line + "vscode-icons-team.vscode-icons", // Better file extension icons + "github.vscode-pull-request-github", // Github interaction + "redhat.vscode-yaml", // Kubernetes, Drone syntax highlighting + "bajdzis.vscode-database", // Supports connections to mysql or postgres, over SSL, socked + "IBM.output-colorizer", // Colorize your output/test logs + "github.copilot" // AI code completion + // "mohsen1.prettify-json", // Prettify JSON data + // "zxh404.vscode-proto3", // Supports Proto syntax + // "jrebocho.vscode-random", // Generates random values + // "alefragnani.Bookmarks", // Manage bookmarks + // "quicktype.quicktype", // Paste JSON as code + // "spikespaz.vscode-smoothtype", // smooth cursor animation + ], + "settings": { + "files.eol": "\n", + "editor.formatOnSave": true, + "go.buildTags": "", + "go.toolsEnvVars": { + "CGO_ENABLED": "0" + }, + "go.useLanguageServer": true, + "go.testEnvVars": { + "CGO_ENABLED": "1" + }, + "go.testFlags": [ + "-v", + "-race" + ], + "go.testTimeout": "10s", + "go.coverOnSingleTest": true, + "go.coverOnSingleTestFile": true, + "go.coverOnTestPackage": true, + "go.lintTool": "golangci-lint", + "go.lintOnSave": "package", + "[go]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, + "gopls": { + "usePlaceholders": false, + "staticcheck": true, + "vulncheck": "Imports" + }, + "remote.extensionKind": { + "ms-azuretools.vscode-docker": "workspace" + } + } + } } } \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 7a56282f4..e2ac932d5 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -5,8 +5,6 @@ services: build: . volumes: - ../:/workspace - # Docker - - ~/.docker:/root/.docker:z # Docker socket to access Docker server - /var/run/docker.sock:/var/run/docker.sock # SSH directory for Linux, OSX and WSL @@ -15,11 +13,9 @@ services: # from /mnt/ssh to ~/.ssh to fix permissions. - ~/.ssh:/mnt/ssh # Shell history persistence - - ~/.zsh_history:/root/.zsh_history:z + - ~/.zsh_history:/root/.zsh_history # Git config - - ~/.gitconfig:/root/.gitconfig:z - # Kubernetes - - ~/.kube:/root/.kube:z + - ~/.gitconfig:/root/.gitconfig environment: - TZ= cap_add: