From 917839a6db71af5b0ff7c9f615ba9f597e2cbbcf Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 22 May 2020 09:12:08 +0200 Subject: [PATCH 1/3] use golangci linters --- .drone.star | 4 ++-- .golangci.yml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 6 +++--- tools.go | 2 +- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .golangci.yml diff --git a/.drone.star b/.drone.star index 1c6224efcd..6f7535ceef 100644 --- a/.drone.star +++ b/.drone.star @@ -73,10 +73,10 @@ def testing(ctx): }, { 'name': 'staticcheck', - 'image': 'webhippie/golang:1.13', + 'image': image: golangci/golangci-lint:latest', 'pull': 'always', 'commands': [ - 'make staticcheck', + golangci-lint run, ], 'volumes': [ { diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000..163c2c98ad --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,34 @@ +issues: + exclude-rules: + - path: pkg/proto/v0/settings.pb.go + text: "SA1019:" + linters: + - staticcheck + - path: pkg/store/filesystem/io.go + text: "SA1019:" + linters: + - staticcheck +linters: + enable: + - bodyclose + - deadcode + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - structcheck + - typecheck + - unused + - varcheck + - depguard + - golint + - goimports + - unconvert + - scopelint + - maligned + - misspell + - gocritic + - prealloc + #- gosec + diff --git a/Makefile b/Makefile index 51a4724a11..bf62e5d69f 100644 --- a/Makefile +++ b/Makefile @@ -71,9 +71,9 @@ fmt: vet: go vet $(PACKAGES) -.PHONY: staticcheck -staticcheck: - go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES) +# .PHONY: staticcheck +# staticcheck: +# go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES) .PHONY: lint lint: diff --git a/tools.go b/tools.go index e421f5285c..89c783a7ee 100644 --- a/tools.go +++ b/tools.go @@ -7,5 +7,5 @@ import ( _ "github.com/mitchellh/gox" _ "github.com/restic/calens" _ "golang.org/x/lint/golint" - _ "honnef.co/go/tools/cmd/staticcheck" + // _ "honnef.co/go/tools/cmd/staticcheck" ) From b39489e9dd4fe38a0eabe83df744abbed55d067c Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 22 May 2020 09:14:58 +0200 Subject: [PATCH 2/3] syntax fix, yet again --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 6f7535ceef..a2f8b61029 100644 --- a/.drone.star +++ b/.drone.star @@ -73,7 +73,7 @@ def testing(ctx): }, { 'name': 'staticcheck', - 'image': image: golangci/golangci-lint:latest', + 'image': golangci/golangci-lint:latest', 'pull': 'always', 'commands': [ golangci-lint run, From 693e26149100176322b132b533246664eef578db Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 22 May 2020 09:17:40 +0200 Subject: [PATCH 3/3] add missing quote --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index a2f8b61029..288302b606 100644 --- a/.drone.star +++ b/.drone.star @@ -73,7 +73,7 @@ def testing(ctx): }, { 'name': 'staticcheck', - 'image': golangci/golangci-lint:latest', + 'image': 'golangci/golangci-lint:latest', 'pull': 'always', 'commands': [ golangci-lint run,