Skip to content

Commit

Permalink
Merge pull request #35 from stelligent/feature/30
Browse files Browse the repository at this point in the history
Add Readme for VS Code remote
  • Loading branch information
Keith Monihen committed Aug 15, 2019
2 parents c4dd11c + 7f01589 commit a098109
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,17 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM circleci/golang:1.11
ENV GO111MODULE=on

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Or your actual UID, GID on Linux if not the default 1000
ARG USERNAME=circleci
ARG USER_UID=3434
ARG USER_GID=$USER_UID


23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,23 @@
{
"name": "Go",
"dockerFile": "Dockerfile",
"appPort": 9000,
"extensions": [
"ms-vscode.go"
],
"runArgs": [
// Comment out the next two lines to run as root instead. Linux users,
// update Dockerfile with your user's UID/GID if not 1000.
"-u",
"circleci",
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"settings": {
"go.gopath": "/go",
"go.inferGopath": true,
"go.useLanguageServer": true
},
"postCreateCommand": "echo 'make vscoderemotedev'; make vscoderemotedev"
}
26 changes: 26 additions & 0 deletions Makefile
Expand Up @@ -10,6 +10,30 @@ CLI_FILES = $(shell find cli linter assertion -name \*.go)

default: all

devdeps:
@echo "=== dev dependencies ==="
@go get "github.com/gobuffalo/packr/..."
@go get -u golang.org/x/lint/golint
@go get "github.com/fzipp/gocyclo"

vscoderemotedeps:
@echo "=== vscode remote dev dependencies ==="
# Install gocode-gomod
@go get -x -d github.com/stamblerre/gocode 2>&1 \
&& go build -o gocode-gomod github.com/stamblerre/gocode \
&& mv gocode-gomod $$GOPATH/bin/ \
&& go get -u -v \
github.com/mdempsky/gocode \
github.com/uudashr/gopkgs/cmd/gopkgs \
github.com/ramya-rao-a/go-outline \
github.com/acroca/go-symbols \
golang.org/x/tools/cmd/gopls \
golang.org/x/tools/cmd/guru \
golang.org/x/tools/cmd/gorename \
github.com/go-delve/delve/cmd/dlv \
golang.org/x/tools/cmd/goimports \
github.com/rogpeppe/godef 2>&1

deps:
@echo "=== dependencies ==="
go mod download
Expand Down Expand Up @@ -51,6 +75,8 @@ $(BUILD_DIR)/config-lint: $(CLI_FILES)
build: gen $(BUILD_DIR)/config-lint

all: clean deps test build
dev: deps devdeps
vscoderemotedev: deps devdeps vscoderemotedeps

clean:
@echo "=== cleaning ==="
Expand Down
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -163,7 +163,16 @@ The files will *not* be scanned for violations.

The overall design in described [here](docs/design.md).

# Development
# VS Code Remote Development
The preferred method of developing is to use the VS Code Remote development functionality.

- Install the VS Code [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack)
- Open the repo in VS Code
- When prompted "`Folder contains a dev container configuration file. Reopen folder to develop in a container`" click the "`Reopen in Container`" button
- When opening in the future use the "`config-lint [Dev Container]`" option


# Local Development

## Prerequisites
- [Install golang](https://golang.org/doc/install)
Expand Down

0 comments on commit a098109

Please sign in to comment.