Revert golangci-lint to use new-from-rev pinned at 1.23.8 (#9072)
Turns out linting each file individually causes issues with the linter not being able to find the import types.
This commit is contained in:
parent
e8f8ebf132
commit
7ec55860e5
3
Makefile
3
Makefile
|
@ -61,6 +61,7 @@ install-gen-deps: ## Install dependencies for code generation
|
|||
@go install ./cmd/mapstructure-to-hcl2
|
||||
|
||||
install-lint-deps: ## Install linter dependencies
|
||||
# Pinning golangci-lint at v1.23.8 as --new-from-rev seems to work properly; the latest 1.24.0 has caused issues with memory consumption
|
||||
@echo "==> Updating linter dependencies..."
|
||||
@curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.23.8
|
||||
|
||||
|
@ -86,7 +87,7 @@ lint: install-lint-deps ## Lint Go code
|
|||
|
||||
ci-lint: install-lint-deps ## On ci only lint newly added Go source files
|
||||
@echo "==> Running linter on newly added Go source files..."
|
||||
@GO111MODULE=on sh -c "$(CURDIR)/scripts/lint.sh"
|
||||
GO111MODULE=on golangci-lint run --new-from-rev=$(shell git merge-base origin/master HEAD) ./...
|
||||
|
||||
fmt: ## Format Go code
|
||||
@go fmt ./...
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
CHANGED_FILES=$(git diff --name-status `git merge-base origin/master HEAD`...HEAD | grep '^A.*\.go$'| awk '{print $2}')
|
||||
if [ ! -z "${CHANGED_FILES}" ]; then
|
||||
echo $CHANGED_FILES | xargs -n1 golangci-lint run
|
||||
fi
|
Loading…
Reference in New Issue