-
Notifications
You must be signed in to change notification settings - Fork 63
/
devcontainer.json
106 lines (106 loc) · 4.19 KB
/
devcontainer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.106.0/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "app",
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yml"
],
// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "service",
// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/app",
// All containers should stop if we close / reload the VSCode window.
"shutdownAction": "stopCompose",
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
// https://github.com/golang/tools/blob/master/gopls/doc/vscode.md#vscode
"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,
},
},
"[sql]": {
"editor.formatOnSave": true
},
// There are handly utility scripts within /scripts that we invoke via go run.
// These scripts (and its dependencies) should never be consumed by the actual server directly
// Thus they are flagged to require the "scripts" build tag.
// We only inform gopls and the vscode go compiler here, that it has to set this build tag if it sees such a file.
"go.buildTags": "scripts",
"gopls": {
// Add parameter placeholders when completing a function.
"usePlaceholders": true,
// If true, enable additional analyses with staticcheck.
// Warning: This will significantly increase memory usage.
// DISABLED, done via
"staticcheck": false,
},
// https://code.visualstudio.com/docs/languages/go#_intellisense
"go.autocompleteUnimportedPackages": true,
// https://github.com/golangci/golangci-lint#editor-integration
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast",
"--timeout",
"5m"
],
// disable test caching, race and show coverage (in sync with makefile)
"go.testFlags": [
"-cover",
"-race",
"-count=1",
"-v"
],
"go.coverMode": "atomic", // atomic is required when utilizing -race
"go.delveConfig": {
"dlvLoadConfig": {
// increase max length of strings displayed in debugger
"maxStringLen": 2048,
},
"apiVersion": 2,
},
// ensure that the pgFormatter VSCode extension uses the pgFormatter that comes preinstalled in the Dockerfile
"pgFormatter.pgFormatterPath": "/usr/local/bin/pg_format"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
// required:
"golang.go",
"bradymholt.pgformatter",
// optional:
"42crunch.vscode-openapi",
"heaths.vscode-guid",
"bungcip.better-toml",
"eamodio.gitlens",
"casualjim.gotemplate",
"yzhang.markdown-all-in-one"
]
}
},
// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created - for example installing git.
"postCreateCommand": "go version",
// "postCreateCommand": "apt-get update && apt-get install -y git",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": ""
}