Updated Makefile and Tavis config to include lint and vet tasks

This commit is contained in:
Stash Dev
2019-02-14 12:06:37 -08:00
parent d3f868f4da
commit 14df7b0700
2 changed files with 26 additions and 2 deletions

View File

@@ -3,13 +3,20 @@ go:
- 1.11.x
services:
- docker
env:
global:
- GO111MODULE=on
before_install:
- echo -e "machine github.com\n login $CI_USER_TOKEN" > ~/.netrc
- cd ui/v1
- yarn install
- ./node_modules/@angular/cli/bin/ng build --prod
- cd ../..
script: go test
- go get -v golang.org/x/lint/golint
script:
- make lint
- make vet
- go test
before_deploy:
- docker pull bepsays/ci-goreleaser
- go get -u github.com/gobuffalo/packr/v2/packr2

View File

@@ -4,5 +4,22 @@ build:
install:
packr2 install
# Regenerates GraphQL files
.PHONY: gqlgen
gqlgen:
go run scripts/gqlgen.go
# Runs gofmt -w on the project's source code, modifying any files that do not match its style.
.PHONY: fmt
fmt:
go list ./... | grep -v vendor | xargs go fmt
# Runs go vet on the project's source code.
# https://stackoverflow.com/questions/40531874/how-to-make-go-linters-ignore-vendor
.PHONY: vet
vet:
go list ./... | grep -v vendor | xargs go vet
.PHONY: lint
lint:
go list ./... | grep -v vendor | xargs golint -set_exit_status