Fix golangci-lint target for non GOPATH installations (#12934)
* Fix golangci-lint target for non GOPATH installations * Link to https://github.com/golangci/golangci-lint#install
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7d0d7c304e
Коммит
bc2b8b85fb
10
Makefile
10
Makefile
@@ -173,17 +173,15 @@ gofmt: ## Runs gofmt against all packages.
|
||||
done
|
||||
@echo "gofmt success"; \
|
||||
|
||||
golangci-lint:
|
||||
golangci-lint: ## Run golangci-lint on codebasis
|
||||
# https://stackoverflow.com/a/677212/1027058 (check if a command exists or not)
|
||||
# https://github.com/golangci/golangci-lint#binary-release
|
||||
# It is recommended to NOT use go get, but instead use a binary release pinned to a version.
|
||||
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
||||
echo "golangci-lint is not installed. Please run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOPATH)/bin v1.21.0"; \
|
||||
@if ! [ -x "$$(command -v golangci-lintt)" ]; then \
|
||||
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
|
||||
$(GOPATH)/bin/golangci-lint run
|
||||
golangci-lint run
|
||||
|
||||
megacheck: ## Run megacheck on codebasis
|
||||
env GO111MODULE=off go get -u honnef.co/go/tools/cmd/megacheck
|
||||
|
||||
Ссылка в новой задаче
Block a user