Skip to content

Commit

Permalink
Enforce test, vet, lint, and fmt in make
Browse files Browse the repository at this point in the history
* Replace test and git-version script with commands
  • Loading branch information
dghubble committed Feb 6, 2019
1 parent 193f137 commit df3ac83
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.9
- "1.9.x"
- "1.10.x"
- "1.11.x"
install:
Expand Down
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ export CGO_ENABLED:=0
export GO111MODULE=on
export GOFLAGS=-mod=vendor

VERSION=$(shell ./scripts/git-version)
GOPATH_BIN:=$(shell echo ${GOPATH} | awk 'BEGIN { FS = ":" }; { print $1 }')/bin
VERSION=$(shell git describe --tags --match=v* --always --dirty)

.PHONY: all
all: bin/terraform-provider-matchbox
all: build test vet lint fmt

.PHONY: build
bin/terraform-provider-matchbox:
Expand All @@ -18,7 +17,19 @@ install: bin/terraform-provider-matchbox

.PHONY: test
test:
@./scripts/test
@go test ./... -cover

.PHONY: vet
vet:
@go vet -all ./...

.PHONY: lint
lint:
@golint -set_exit_status `go list ./...`

.PHONY: fmt
fmt:
@test -z $$(go fmt ./...)

.PHONY: update
update:
Expand Down
21 changes: 0 additions & 21 deletions scripts/git-version

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/test

This file was deleted.

0 comments on commit df3ac83

Please sign in to comment.