Skip to content

Commit

Permalink
Add lint and continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Dec 29, 2017
1 parent 1c32a4d commit 4f6213e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go
go:
- "1.9"
install:
- make install-ci
script:
- make ci

4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@

GO_FILES := $(shell git ls-files | grep "\.go$$")

PACKAGES := $(shell find $(GO_FILES) | xargs -n1 dirname | sed 's:^:./:'| uniq)

.PHONY: test
test:
go test ./...

.PHONY: gofmt
gofmt:
gofmt -e -s -l $(GO_FILES)

.PHONY: govet
govet:
go vet ./...

.PHONY: golint
golint:
golint $(PACKAGES)

.PHONY: errcheck
errcheck:
errcheck -ignoretests $(PACKAGES)

.PHONY: lint
lint: gofmt govet golint errcheck

.PHONY: install
install:
dep ensure

.PHONY: install-ci
install-ci:
go get -u github.com/golang/dep/cmd/dep github.com/golang/lint/golint github.com/kisielk/errcheck
dep ensure

.PHONY: ci
ci: test lint

run/%: proofs/%
go run $(shell find $< -maxdepth 1 -name *.go -not -name *_test.go)

Expand Down

0 comments on commit 4f6213e

Please sign in to comment.