learning_go/rbd_exporter/scripts/devp/install/golangci-lint.gen.mk
2025-12-23 06:40:56 +03:00

22 lines
1.2 KiB
Makefile

DEVP_GOLANG_CI_LINT_VERSION = v2.7.2
DEVP_GOLANG_CI_LINT_DIR = ${DEVP_TOOLS_ROOT}/golangci-lint/${DEVP_GOLANG_CI_LINT_VERSION}/curl
DEVP_GOLANG_CI_LINT_EXE = ${DEVP_GOLANG_CI_LINT_DIR}/golangci-lint
${DEVP_GOLANG_CI_LINT_EXE}:
ifdef DEVP_NO_INSTALL
ifneq ($(DEVP_VERSION),$(DEVP_CI_BUILDER_VERSION))
$(call error_message,"Platform version is [${DEVP_VERSION}] image version is [${DEVP_CI_BUILDER_VERSION}]. Same version is expected. Updating with [make devp/update] might help. DEVP_NO_INSTALL == 1. See: https://mws.pages.mws-team.ru/devp/platform-go-tools/pgt/user/pages/platform-update.html")
@exit 1
endif
$(call error_message,"[golangci-lint] is expected to be installed but it is not. Please contact /duty golang for support.")
@exit 1
endif
$(Q) mkdir -p ${DEVP_GOLANG_CI_LINT_DIR}
# https://golangci-lint.run/usage/install/#local-installation
$(Q) bash -eo pipefail -c "curl -m 60 -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b ${DEVP_GOLANG_CI_LINT_DIR} ${DEVP_GOLANG_CI_LINT_VERSION} $(if $(VERBOSE),, 2>/dev/null)"
$(call green,"golangci-lint installed as $@")
.PHONY: devp/install/golangci-lint
devp/install/golangci-lint: ${DEVP_GOLANG_CI_LINT_EXE}
@# Install golangci-lint - v2.7.2