From 1216dc6a5b6bf7ced81ec2382bf3f93fc0f44e22 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Fri, 13 Sep 2019 10:50:34 +0200 Subject: [PATCH 1/2] build: pin golangci-lint version To prevent builds breaking when golangci-lint or any of the linters is updated. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7703ff42..451cce3f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ MOBILE_PKG := $(PKG)/mobile BTCD_PKG := github.com/btcsuite/btcd GOVERALLS_PKG := github.com/mattn/goveralls -LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint +LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0 GOACC_PKG := github.com/ory/go-acc GO_BIN := ${GOPATH}/bin @@ -71,7 +71,10 @@ $(GOVERALLS_BIN): $(LINT_BIN): @$(call print, "Fetching linter") - GO111MODULE=off go get -u $(LINT_PKG) + # Switch to tmp directory to prevent lnd go.mod from being modified. + # Hopefully someday a flag for go get will be added for this. + cd /tmp + GO111MODULE=on go get $(LINT_PKG) $(GOACC_BIN): @$(call print, "Fetching go-acc") From 23517587aa96775a0b985416d495948b7a16610f Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Fri, 13 Sep 2019 11:15:43 +0200 Subject: [PATCH 2/2] build: disable funlen --- .golangci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 8cc1bc86..0ab310bd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,6 +37,10 @@ linters: # We don't care (enough) about misaligned structs to lint that. - maligned + # We have long functions, especially in tests. Moving or renaming those would + # trigger funlen problems that we may not want to solve at that time. + - funlen + issues: # Only show newly introduced problems. new-from-rev: 01f696afce2f9c0d4ed854edefa3846891d01d8a