forked from TrueCloudLab/xk6-frostfs
[#161] Makefile: add target to install golangci-lint
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
2997541e35
commit
ad8d7d79ce
1 changed files with 14 additions and 1 deletions
15
Makefile
15
Makefile
|
@ -7,6 +7,10 @@ GO_VERSION ?= 1.22
|
|||
LINT_VERSION ?= 1.60.3
|
||||
BINDIR = bin
|
||||
|
||||
OUTPUT_LINT_DIR ?= $(abspath $(BINDIR))/linters
|
||||
LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)
|
||||
TMP_DIR := .cache
|
||||
|
||||
# Binaries to build
|
||||
CMDS = $(addprefix frostfs-, $(notdir $(wildcard cmd/*)))
|
||||
BINS = $(addprefix $(BINDIR)/, $(CMDS))
|
||||
|
@ -64,7 +68,16 @@ format:
|
|||
|
||||
# Run linters
|
||||
lint:
|
||||
@golangci-lint --timeout=5m run
|
||||
@if [ ! -d "$(LINT_DIR)" ]; then \
|
||||
make lint-install; \
|
||||
fi
|
||||
$(LINT_DIR)/golangci-lint run --timeout=5m
|
||||
|
||||
# Install linters
|
||||
lint-install:
|
||||
@rm -rf $(OUTPUT_LINT_DIR)
|
||||
@mkdir -p $(OUTPUT_LINT_DIR)
|
||||
@CGO_ENABLED=1 GOBIN=$(LINT_DIR) go install -trimpath github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINT_VERSION)
|
||||
|
||||
# Run linters in Docker
|
||||
docker/lint:
|
||||
|
|
Loading…
Reference in a new issue