Skip to content

Commit

Permalink
linter should not change global tools (#195)
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Sipe <[email protected]>
  • Loading branch information
kensipe authored Aug 10, 2020
1 parent da41723 commit 7b0360a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILD_DATE_PATH := github.com/kudobuilder/kuttl/pkg/version.buildDate
DATE_FMT := "%Y-%m-%dT%H:%M:%SZ"
BUILD_DATE := $(shell date -u -d "@$SOURCE_DATE_EPOCH" "+${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "+${DATE_FMT}" 2>/dev/null || date -u "+${DATE_FMT}")
LDFLAGS := -X ${GIT_VERSION_PATH}=${GIT_VERSION} -X ${GIT_COMMIT_PATH}=${GIT_COMMIT} -X ${BUILD_DATE_PATH}=${BUILD_DATE}
GOLANGCI_LINT_VER = "1.29.0"
GOLANGCI_LINT_VER = "1.30.0"

export GO111MODULE=on

Expand All @@ -31,11 +31,12 @@ help: ## Show this help screen

.PHONY: lint
lint: ## Run golangci-lint
ifneq (${GOLANGCI_LINT_VER}, "$(shell golangci-lint --version | cut -b 27-32)")
./hack/install-golangcilint.sh
ifneq (${GOLANGCI_LINT_VER}, "$(shell ./bin/golangci-lint --version 2>/dev/null | cut -b 27-32)")
@echo "golangci-lint missing or not version '${GOLANGCI_LINT_VER}', downloading..."
curl -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_LINT_VER}/install.sh" | sh -s -- -b ./bin "v${GOLANGCI_LINT_VER}"
endif
golangci-lint run

./bin/golangci-lint --timeout 3m run
.PHONY: download
download: ## Downloads go dependencies
go mod download
Expand Down
9 changes: 0 additions & 9 deletions hack/install-golangcilint.sh

This file was deleted.

0 comments on commit 7b0360a

Please sign in to comment.