Adding lint check for syntax and style.
This commit is contained in:
1 parent
d5c2b34e2e
commit
2f0045db2e
2 files changed
+15
No files matched your search
@@ -181,6 +181,8 @@ install: external
|
||||
check test: external
|
||||
@$(MAKE) go.test
|
||||
|
||||
lint: go.lint
|
||||
|
||||
vet: go.vet
|
||||
|
||||
fmt: go.fmt
|
||||
@@ -226,6 +228,7 @@ help:
|
||||
@echo ' distclean Remove all files that are created '
|
||||
@echo ' by building or configuring.'
|
||||
@echo ' fmt Check formatting of go sources.'
|
||||
@echo ' lint Check syntax and styling of go sources.'
|
||||
@echo ' help Show this help info.'
|
||||
@echo ' vendor Installs vendor dependencies.'
|
||||
@echo ' vet Runs lint checks on go sources.'
|
||||
|
||||
@@ -162,6 +162,10 @@ go.test: go.vet go.fmt
|
||||
# @$(GOHOST) test -v -i $(GO_PKG_FLAGS) $(GO_NONSTATIC_FLAGS) $(GO_ALL_PACKAGES)
|
||||
@$(GOHOST) test -cover $(GO_PKG_FLAGS) $(GO_NONSTATIC_FLAGS) $(GO_ALL_PACKAGES)
|
||||
|
||||
.PHONY: go.lint
|
||||
go.lint: $(GO_TOOLS_DIR)/lint/$(GOHOSTOS)-$(GOHOSTARCH)/golint
|
||||
@$(GO_TOOLS_DIR)/lint/$(GOHOSTOS)-$(GOHOSTARCH)/golint -set_exit_status=true $(GO_ALL_PACKAGES)
|
||||
|
||||
.PHONY: go.vet
|
||||
go.vet:
|
||||
@$(GOHOST) vet $(GO_NONSTATIC_FLAGS) $(GO_ALL_PACKAGES)
|
||||
@@ -183,6 +187,14 @@ $(GO_TOOLS_DIR)/glide:
|
||||
@mv $(GO_TOOLS_DIR)/$(GOHOSTOS)-$(GOHOSTARCH)/glide $(GO_TOOLS_DIR)/glide
|
||||
@rm -r $(GO_TOOLS_DIR)/$(GOHOSTOS)-$(GOHOSTARCH)
|
||||
|
||||
$(GO_TOOLS_DIR)/lint/$(GOHOSTOS)-$(GOHOSTARCH)/golint:
|
||||
@echo "installing golint"
|
||||
@mkdir -p $(GO_TOOLS_DIR)/tmp/lint/bin
|
||||
@GOPATH=`pwd`/$(GO_TOOLS_DIR)/tmp/lint GOBIN=`pwd`/$(GO_TOOLS_DIR)/tmp/lint/bin $(GOHOST) get github.com/golang/lint/golint
|
||||
@mkdir -p $(GO_TOOLS_DIR)/lint/$(GOHOSTOS)-$(GOHOSTARCH)
|
||||
@mv $(GO_TOOLS_DIR)/tmp/lint/bin/golint $(GO_TOOLS_DIR)/lint/$(GOHOSTOS)-$(GOHOSTARCH)/golint
|
||||
@rm -rf $(GO_TOOLS_DIR)/tmp
|
||||
|
||||
.PHONY: go.clean
|
||||
go.clean: ;
|
||||
@rm -rf $(GO_BIN_DIR)/*
|
||||
|
||||
Reference in new issue
Block a user