From a1f1d233cc296f347510d86e9a73414433e4c4b1 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 16 Aug 2023 18:26:36 +0300 Subject: [PATCH] [#618] linters: bump truecloudlab-linters to 0.0.2 Signed-off-by: Alexander Chuprov --- .golangci.yml | 11 ++++++----- Makefile | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 6741f1278..ef99fc152 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -38,13 +38,14 @@ linters-settings: pkg: git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object alias: objectSDK custom: - noliteral: + truecloudlab-linters: 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-package: "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + noliteral: + target-methods : ["reportFlushError", "reportError"] + disable-packages: ["codes", "err", "res","exec"] + constants-package: "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" linters: enable: @@ -77,6 +78,6 @@ linters: - gocognit - contextcheck - importas - - noliteral + - truecloudlab-linters disable-all: true fast: false diff --git a/Makefile b/Makefile index 3914986b5..604115469 100755 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" GO_VERSION ?= 1.21 LINT_VERSION ?= 1.54.0 +TRUECLOUDLAB_LINT_VERSION ?= 0.0.2 ARCH = amd64 BIN = bin @@ -26,7 +27,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) +LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) TMP_DIR := .cache .PHONY: help all images dep clean fmts fmt imports test lint docker/lint @@ -139,7 +140,7 @@ pre-commit-run: 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 + @git -c advice.detachedHead=false clone --branch v$(TRUECLOUDLAB_LINT_VERSION) https://git.frostfs.info/TrueCloudLab/linters.git $(TMP_DIR)/linters @@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