From 64cfe397fba7107ed35d5622c8d39c0848bde89c Mon Sep 17 00:00:00 2001 From: Francesco Casula Date: Wed, 22 Nov 2023 15:54:55 +0100 Subject: [PATCH 1/2] chore: golangci-lint no docker --- Makefile | 4 ++-- internal/scripts/install-golangci-lint.sh | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 internal/scripts/install-golangci-lint.sh diff --git a/Makefile b/Makefile index 6e76dcb4..9bce1106 100644 --- a/Makefile +++ b/Makefile @@ -50,11 +50,11 @@ install-tools: go install mvdan.cc/gofumpt@latest go install gotest.tools/gotestsum@v1.8.2 go install golang.org/x/tools/cmd/goimports@latest + bash ./internal/scripts/install-golangci-lint.sh v1.55.2 .PHONY: lint lint: fmt ## Run linters on all go files - docker run --rm -v $(shell pwd):/app:ro -w /app golangci/golangci-lint:v1.54.2 bash -e -c \ - 'golangci-lint run -v --timeout 5m' + golangci-lint run -v --timeout 5m .PHONY: fmt fmt: install-tools ## Formats all go files diff --git a/internal/scripts/install-golangci-lint.sh b/internal/scripts/install-golangci-lint.sh new file mode 100755 index 00000000..e6c89d7d --- /dev/null +++ b/internal/scripts/install-golangci-lint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +VERSION=$1 +[ -z "${VERSION}" ] && VERSION="v1.55.2" +GOPATH=$(go env GOPATH) +[ -f "${GOPATH}/bin/golangci-lint-${VERSION}" ] && echo "golangci-lint ${VERSION} is already installed" || \ +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh | sh -s -- -b ${GOPATH}/bin ${VERSION} && \ +cp ${GOPATH}/bin/golangci-lint ${GOPATH}/bin/golangci-lint-${VERSION} From 7874267ae1286b41defdca877b3cd8deca627dbb Mon Sep 17 00:00:00 2001 From: Francesco Casula Date: Wed, 22 Nov 2023 15:56:28 +0100 Subject: [PATCH 2/2] chore: updating CI version --- .github/workflows/verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 8dc19e61..3ece2276 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -50,4 +50,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.54.2 + version: v1.55.2