Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Add linting instructions to Developer's Guide
Browse files Browse the repository at this point in the history
Also add documentation link.
  • Loading branch information
glyn committed Mar 20, 2019
1 parent 92a8228 commit 2574b1b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ lint:

HAS_DEP := $(shell $(CHECK) dep)
HAS_GOLANGCI := $(shell $(CHECK) golangci-lint)
HAS_GOIMPORTS := $(shell $(CHECK) goimports)

.PHONY: build-drivers
build-drivers:
Expand All @@ -88,5 +89,13 @@ ifndef HAS_DEP
endif
ifndef HAS_GOLANGCI
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin
endif
ifndef HAS_GOIMPORTS
go get -u golang.org/x/tools/cmd/goimports
endif
dep ensure -vendor-only -v

.PHONY: goimports
goimports:
find . -name "*.go" | fgrep -v vendor/ | xargs goimports -w -local github.com/deislabs/duffle

3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ The following documentation is available:
3. [Duffle Build](./proposal/203-duffle-build.md)
4. [Duffle Export/Import](./proposal/204-export-import.md)
3. Developer Information
1. [Debugging](debugging.md)
1. [Developer's Guide](developing.md)
2. [Debugging Duffle using VS Code](debugging.md)
21 changes: 16 additions & 5 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ $ go get -d github.com/deislabs/duffle/...
$ cd $(go env GOPATH)/src/github.com/deislabs/duffle
```

## Building

### Prerequisites
You need:
* A working Go 1.11.4 (or later) environment
* make

Before you start, issue:
Before you start working with the code, issue:
```console
$ make bootstrap
```

Then, to build `duffle`, issue:
## Building

To build `bin/duffle`, issue:
```console
$ make build
```
The resultant binary is placed in `bin/duffle`.

If you want to install `duffle`, issue:
```console
Expand All @@ -38,6 +37,18 @@ To run the tests, issue:
$ make test
```

## Linting

To lint the code, issue:
```console
$ make lint
```

If this detects that some imports need re-organising (errors like "File is not `goimports`-ed"), issue:
```console
$ make goimports
```

## Debugging

For instructions on using VS Code to debug the Duffle binary, see [the debugging document](debugging.md).

0 comments on commit 2574b1b

Please sign in to comment.