mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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 ```
This commit is contained in:
@@ -202,10 +202,11 @@ jobs:
|
||||
make gen-serialized
|
||||
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
|
||||
check-golangci-lint:
|
||||
docker:
|
||||
# Keep the version in sync with the command in Makefile
|
||||
- image: golangci/golangci-lint:v1.39.0
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
11
Makefile
11
Makefile
@@ -243,17 +243,14 @@ else
|
||||
endif
|
||||
|
||||
golangci-lint: ## Run golangci-lint on codebase
|
||||
# https://stackoverflow.com/a/677212/1027058 (check if a command exists or not)
|
||||
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
||||
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
@# Keep the version in sync with the command in .circleci/config.yml
|
||||
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.39.0
|
||||
|
||||
@echo Running golangci-lint
|
||||
golangci-lint run ./...
|
||||
$(GOBIN)/golangci-lint run ./...
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
ifneq ($(MM_NO_ENTERPRISE_LINT),true)
|
||||
golangci-lint run ./enterprise/...
|
||||
$(GOBIN)/golangci-lint run ./enterprise/...
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user