From ad87493c41c7b6225ba439fbc044821f47b2ac12 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Fri, 11 Aug 2023 13:05:16 +0300 Subject: [PATCH] [#8] Bump required go version to go1.20 Signed-off-by: Alexander Chuprov --- .golangci.yml | 8 ++++---- Makefile | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 12ebe04c..845ab220 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,10 +41,10 @@ linters-settings: noliteral: path: bin/external_linters.so original-url: git.frostfs.info/TrueCloudLab/linters.git -# settings: -# target-methods : ["reportFlushError", "reportError"] -# disable-packages: ["codes", "err", "res","exec"] -# constants-repository: "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + settings: + target-methods : ["reportFlushError", "reportError"] + disable-packages: ["codes", "err", "res","exec"] + constants-package: "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" linters: enable: diff --git a/Makefile b/Makefile index ed222efc..3914986b 100755 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ HUB_IMAGE ?= truecloudlab/frostfs HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" GO_VERSION ?= 1.21 -LINT_VERSION ?= 1.53.3 +LINT_VERSION ?= 1.54.0 +ARCH = amd64 BIN = bin RELEASE = release @@ -25,6 +26,7 @@ PKG_VERSION ?= $(shell echo $(VERSION) | sed "s/^v//" | \ sed "s/-/~/")-${OS_RELEASE} OUTPUT_LINT_DIR ?= $(shell pwd)/bin +LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION) TMP_DIR := .cache .PHONY: help all images dep clean fmts fmt imports test lint docker/lint @@ -138,18 +140,18 @@ lint-install: @mkdir -p $(TMP_DIR) @rm -rf $(TMP_DIR)/linters @git clone --depth 1 https://git.frostfs.info/TrueCloudLab/linters.git $(TMP_DIR)/linters - @make -C $(TMP_DIR)/linters lib CGO_ENABLED=1 OUT_DIR=$(OUTPUT_LINT_DIR) + @@make -C $(TMP_DIR)/linters lib CGO_ENABLED=1 OUT_DIR=$(OUTPUT_LINT_DIR) @rm -rf $(TMP_DIR)/linters @rmdir $(TMP_DIR) 2>/dev/null || true - @GOBIN=$(OUTPUT_LINT_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINT_VERSION) - + @CGO_ENABLED=1 GOBIN=$(LINT_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINT_VERSION) # Run linters lint: - NOLITERAL_TARGET_METHODS="reportFlushError,reportError" \ - NOLITERAL_DISABLE_PACKAGES="codes,err,res,exec" \ - NOLITERAL_CONSTANTS_PACKAGE="git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" \ - $(OUTPUT_LINT_DIR)/golangci-lint --timeout=10m run + @if [ ! -d "$(LINT_DIR)" ]; then \ + echo "Run make lint-install"; \ + exit 1; \ + fi + $(LINT_DIR)/golangci-lint run # Install staticcheck staticcheck-install: