File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,35 @@ PKG := github.com/lightninglabs/loop
22
33GOTEST := GO111MODULE=on go test -v
44
5+ GO_BIN := ${GOPATH}/bin
6+
7+ GOFILES_NOVENDOR = $(shell find . -type f -name '* .go' -not -path "./vendor/* ")
58GOLIST := go list $(PKG ) /... | grep -v '/vendor/'
69
10+ LINT_BIN := $(GO_BIN ) /golangci-lint
11+ LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
12+ LINT_COMMIT := v1.18.0
13+ LINT = $(LINT_BIN ) run -v
14+
15+ DEPGET := cd /tmp && GO111MODULE=on go get -v
716XARGS := xargs -L 1
817
918TEST_FLAGS = -test.timeout=20m
1019
1120UNIT := $(GOLIST ) | $(XARGS ) env $(GOTEST ) $(TEST_FLAGS )
1221
22+ $(LINT_BIN ) :
23+ @$(call print, "Fetching linter")
24+ $(DEPGET ) $(LINT_PKG ) @$(LINT_COMMIT )
25+
1326unit :
1427 @$(call print, "Running unit tests.")
1528 $(UNIT )
29+
30+ fmt :
31+ @$(call print, "Formatting source.")
32+ gofmt -l -w -s $(GOFILES_NOVENDOR )
33+
34+ lint : $(LINT_BIN )
35+ @$(call print, "Linting source.")
36+ $(LINT )
You can’t perform that action at this time.
0 commit comments