Skip to content

Commit

Permalink
Add step to lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinkarthik committed Aug 12, 2019
1 parent f9f0c0a commit 796d908
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
gobuild_args: -ldflags "-X main.version=${TRAVIS_TAG}"

script:
- go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- make lint test
- GOOS=linux go build

after_success:
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ MAKEFLAGS += --silent
## install: Install missing dependencies. Runs `go get` internally. e.g; make install get=github.com/foo/bar
install: go-get

## lint: Lint the codebase using golangci-lint
lint:
ifeq (,$(wildcard ./out/golangci-lint))
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOBIN)
endif
$(GOBIN)/golangci-lint run -v ./...

## test: Run all tests
test:
@-$(MAKE) -s go-test
Expand Down Expand Up @@ -57,7 +64,7 @@ go-vendor:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go mod vendor

go-test:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go test -v ./...
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...

richgo-test:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) richgo test -v ./...
Expand Down

0 comments on commit 796d908

Please sign in to comment.