Pin GolangCI to a specific version (#19505)
* Pin GolangCI to a specific version Go 1.16+ allows installing a tool directly from a specific version. Therefore, we don't need to rely on the tool being pre-installed and can directly install it using standard method. This keeps the same version of the tool for a repo and limits the binary placement to the GOBIN of the repo. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ca8eb1347b
Коммит
569ee94116
@@ -202,10 +202,11 @@ jobs:
|
|||||||
make gen-serialized
|
make gen-serialized
|
||||||
if [[ -n $(git status --porcelain) ]]; then echo "Please update the serialized files using 'make gen-serialized'"; exit 1; fi
|
if [[ -n $(git status --porcelain) ]]; then echo "Please update the serialized files using 'make gen-serialized'"; exit 1; fi
|
||||||
|
|
||||||
# Dedicate job for golangci-lint it does not need anything only the server code for that
|
# Dedicated job for golangci-lint it does not need anything only the server code for that
|
||||||
# and to make more clear when the job fails
|
# and to make more clear when the job fails
|
||||||
check-golangci-lint:
|
check-golangci-lint:
|
||||||
docker:
|
docker:
|
||||||
|
# Keep the version in sync with the command in Makefile
|
||||||
- image: golangci/golangci-lint:v1.39.0
|
- image: golangci/golangci-lint:v1.39.0
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -243,17 +243,14 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
golangci-lint: ## Run golangci-lint on codebase
|
golangci-lint: ## Run golangci-lint on codebase
|
||||||
# https://stackoverflow.com/a/677212/1027058 (check if a command exists or not)
|
@# Keep the version in sync with the command in .circleci/config.yml
|
||||||
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.39.0
|
||||||
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
|
|
||||||
exit 1; \
|
|
||||||
fi; \
|
|
||||||
|
|
||||||
@echo Running golangci-lint
|
@echo Running golangci-lint
|
||||||
golangci-lint run ./...
|
$(GOBIN)/golangci-lint run ./...
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
ifneq ($(MM_NO_ENTERPRISE_LINT),true)
|
ifneq ($(MM_NO_ENTERPRISE_LINT),true)
|
||||||
golangci-lint run ./enterprise/...
|
$(GOBIN)/golangci-lint run ./enterprise/...
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user