Enable golint in travis and Makefile

This commit is contained in:
dmaiocchi 2018-12-10 23:17:39 +01:00
parent b8f75ed68d
commit 157d0c73b3
2 changed files with 13 additions and 0 deletions

View File

@ -1,4 +1,7 @@
sudo: required
language: go
dist: trusty
services:
- docker
@ -21,6 +24,12 @@ before_install: |
exit 1
fi
before_script:
- go get golang.org/x/lint/golint
# cephfs (fuse) requires: --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined
script:
- docker run --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined --rm -it -v ${PWD}:/go/src/github.com/ceph/go-ceph:z ceph-golang-ci
# run golint and other style checks
- go get golang.org/x/lint/golint
- make check

View File

@ -12,3 +12,7 @@ test-docker: .build-docker
.build-docker:
docker build -t $(DOCKER_CI_IMAGE) .
@docker inspect -f '{{.Id}}' $(DOCKER_CI_IMAGE) > .build-docker
check:
# TODO: add this when golint is fixed @for d in $$(go list ./... | grep -v /vendor/); do golint -set_exit_status $${d}; done
@for d in $$(go list ./... | grep -v /vendor/); do golint $${d}; done