From 5232164d78dd7e144fd89233bd9c41d0877b4a30 Mon Sep 17 00:00:00 2001 From: Sukhjit Singh Date: Wed, 15 Dec 2021 17:16:41 +1100 Subject: [PATCH] Add golangci linter --- .gitignore | 1 + .golangci.yaml | 11 +++++++++++ Makefile | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100644 .golangci.yaml create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e56e04 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..c50a73b --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,11 @@ +run: + timeout: 5m + +linters: + disable-all: true + enable: + - bodyclose + - deadcode + - ineffassign + - staticcheck + - unused diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..65f2212 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +GOBIN=$(shell pwd)/bin + +install-lint: + @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.42.0 + +lint: install-lint + @echo "golangci-lint run ../..." + @$(GOBIN)/golangci-lint run ./...