-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update dependencies * fsnotify: v1.4.7 * gostats: v0.3.2 * logrus: v1.4.2 * gofmt simplify run gofmt -w -s on the code * Fix Travis CI, update Go, remove Docker and add tests to Makefile
- Loading branch information
Charlie Vieth
authored
Jul 3, 2019
1 parent
212b154
commit fd5ff74
Showing
6 changed files
with
58 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
sudo: required | ||
language: go | ||
go: 1.7.1 | ||
go: | ||
- "1.11" | ||
- "1.12" | ||
|
||
services: | ||
- docker | ||
before_install: mkdir -p $GOPATH/bin | ||
install: make install | ||
script: make test | ||
|
||
install: make bootstrap | ||
script: make tests | ||
# TODO: run 'make lint' once it passes |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,43 @@ | ||
.PHONY: bootstrap | ||
bootstrap: | ||
script/install-glide | ||
# Go source files | ||
SRCS := $(shell find . -type d -name 'vendor' -prune -o -name '*.go' -print) | ||
|
||
.PHONY: install | ||
install: glide #download dependencies (including test deps) for the package | ||
glide install | ||
|
||
.PHONY: update | ||
update: | ||
glide up | ||
glide install | ||
update: glide #updates dependencies used by the package and installs them | ||
glide update | ||
|
||
.PHONY: glide | ||
glide: # ensure the glide package tool is installed | ||
which glide || go get github.com/Masterminds/glide | ||
|
||
.PHONY: lint | ||
lint: #lints the package for common code smells | ||
@for file in $(SRCS); do \ | ||
gofmt -d -s $${file}; \ | ||
if [ -n "$$(gofmt -d -s $${file})" ]; then \ | ||
exit 1; \ | ||
fi; \ | ||
done | ||
which golint || go get -u golang.org/x/lint/golint | ||
which shadow || go get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow | ||
golint -set_exit_status $(shell go list ./...) | ||
go vet -all ./... | ||
go vet -vettool=$(which shadow) ./... | ||
|
||
.PHONY: test | ||
test: # runs all tests against the package with race detection and coverage percentage | ||
go test -race -cover ./... | ||
|
||
.PHONY: quick | ||
quick: # runs all tests without coverage or the race detector | ||
go test ./... | ||
|
||
.PHONY: tests | ||
tests: | ||
go test -cover -race $(shell glide nv) | ||
.PHONY: cover | ||
cover: # runs all tests against the package, generating a coverage report and opening it in the default browser | ||
go test -race -covermode=atomic -coverprofile=cover.out ./... | ||
go tool cover -html cover.out -o cover.html | ||
which open && open cover.html | ||
|
||
.PHONY: docker-tests | ||
docker-tests: | ||
docker run goruntime make tests |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters