From 05e40d3ff3e8f173452d96f2437f20291b598d81 Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Tue, 4 Feb 2020 19:43:48 +0100 Subject: [PATCH] Merge PR #5612: Makefile: remove golangci-lint installation --- Makefile | 4 +-- contrib/devtools/Makefile | 11 ++------ contrib/devtools/install-golangci-lint.sh | 33 ----------------------- 3 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 contrib/devtools/install-golangci-lint.sh diff --git a/Makefile b/Makefile index 03abf9fa66..2e5984dd3a 100644 --- a/Makefile +++ b/Makefile @@ -185,8 +185,8 @@ benchmark: ### Linting ### ############################################################################### -lint: golangci-lint - $(BINDIR)/golangci-lint run +lint: + golangci-lint run find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s go mod verify .PHONY: lint diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index f0bf0ae77b..993d1b7b74 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -1,4 +1,4 @@ -.PHONY: all tools tools-clean statik runsim golangci-lint \ +.PHONY: all tools tools-clean statik runsim \ protoc buf protoc-gen-buf-check-breaking protoc-gen-buf-check-lint protoc-gen-gocosmos ### @@ -47,21 +47,14 @@ UNAME_M ?= $(shell uname -m) GOPATH ?= $(shell $(GO) env GOPATH) GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com -GOLANGCI_LINT_HASHSUM := f11179f445385a4a6d5079d67de63fe48a9113cee8e9ee0ced19327a83a4394b BUF_VERSION ?= 0.4.0 TOOLS_DESTDIR ?= $(GOPATH)/bin -GOLANGCI_LINT = $(TOOLS_DESTDIR)/golangci-lint STATIK = $(TOOLS_DESTDIR)/statik RUNSIM = $(TOOLS_DESTDIR)/runsim -tools: protoc buf statik runsim golangci-lint - -golangci-lint: $(GOLANGCI_LINT) -$(GOLANGCI_LINT): $(mkfile_dir)/install-golangci-lint.sh - @echo "Installing golangci-lint..." - @bash $(mkfile_dir)/install-golangci-lint.sh $(TOOLS_DESTDIR) $(GOLANGCI_LINT_HASHSUM) +tools: protoc buf statik runsim # Install the runsim binary with a temporary workaround of entering an outside # directory as the "go get" command ignores the -mod option and will polute the diff --git a/contrib/devtools/install-golangci-lint.sh b/contrib/devtools/install-golangci-lint.sh deleted file mode 100644 index 3b0842e59c..0000000000 --- a/contrib/devtools/install-golangci-lint.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -installer="$(mktemp)" -trap "rm -f ${installer}" EXIT - -GOBIN="${1}" -CURL="$(which curl)" -HASHSUM="${2}" - -f_sha256() { - local l_file - l_file=$1 - python -sBc "import hashlib;print(hashlib.sha256(open('$l_file','rb').read()).hexdigest())" -} - -get_latest_release() { - "${CURL}" --silent "https://api.github.com/repos/$1/releases/latest" | \ - grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' -} - -VERSION="$(get_latest_release golangci/golangci-lint)" - -echo "Downloading golangci-lint ${VERSION} installer ..." >&2 -"${CURL}" -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh" > "${installer}" - -echo "Checking hashsum ..." >&2 -[ "${HASHSUM}" = "$(f_sha256 ${installer})" ] -chmod +x "${installer}" - -echo "Launching installer ..." >&2 -exec "${installer}" -d -b "${GOBIN}" "${VERSION}"