Lint (#700)
* adjust GNUmakefile by using ... wildcard go command excludes vendored packages from ... wildcard Go1.9 or later * fix vet warnings * fmt
This commit is contained in:
committed by
Kota Kanbe
parent
ea800e04bc
commit
d785fc2a54
@@ -15,7 +15,7 @@
|
||||
clean
|
||||
|
||||
SRCS = $(shell git ls-files '*.go')
|
||||
PKGS = ./. ./cache ./commands ./config ./models ./oval ./report ./scan ./util
|
||||
PKGS = $(shell go list ./...)
|
||||
VERSION := $(shell git describe --tags --abbrev=0)
|
||||
REVISION := $(shell git rev-parse --short HEAD)
|
||||
LDFLAGS := -X 'main.version=$(VERSION)' \
|
||||
@@ -40,11 +40,11 @@ install: main.go dep pretest
|
||||
|
||||
lint:
|
||||
@ go get -v github.com/golang/lint/golint
|
||||
$(foreach file,$(SRCS),golint $(file) || exit;)
|
||||
golint $(PKGS)
|
||||
|
||||
vet:
|
||||
# @-go get -v golang.org/x/tools/cmd/vet
|
||||
echo $(PKGS) | xargs go vet || exit;
|
||||
go vet ./... || exit;
|
||||
|
||||
fmt:
|
||||
gofmt -s -w $(SRCS)
|
||||
@@ -58,7 +58,7 @@ test: pretest
|
||||
go install
|
||||
echo $(PKGS) | xargs go test -cover -v || exit;
|
||||
|
||||
unused :
|
||||
unused:
|
||||
$(foreach pkg,$(PKGS),unused $(pkg);)
|
||||
|
||||
cov:
|
||||
|
||||
Reference in New Issue
Block a user