Skip to content

Commit

Permalink
chore(*) add tidy target for go mod maintenance
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
  • Loading branch information
Nikolay Nikolaev committed May 11, 2020
1 parent 764b80d commit 5ca2b92
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,22 @@ vet: ## Dev: Run go vet
@# for consistency with `fmt`
make vet -C pkg/plugins/resources/k8s/native

.PHONY: tidy
tidy:
@for m in . ./api ./pkg/plugins/resources/k8s/native; do \
pushd $$m ; \
rm go.sum ; \
go mod tidy ; \
popd; \
done

golangci-lint: ## Dev: Runs golangci-lint linter
$(GOLANGCI_LINT_DIR)/golangci-lint run -v

imports: ## Dev: Runs goimports in order to organize imports
goimports -w -local github.com/Kong/kuma -d `find . -type f -name '*.go' -not -name '*.pb.go' -not -path './vendor/*'`

check: generate fmt vet docs golangci-lint imports ## Dev: Run code checks (go fmt, go vet, ...)
check: generate fmt vet docs golangci-lint imports tidy ## Dev: Run code checks (go fmt, go vet, ...)
make generate manifests -C pkg/plugins/resources/k8s/native
git diff --quiet || test $$(git diff --name-only | grep -v -e 'go.mod$$' -e 'go.sum$$' | wc -l) -eq 0 || ( echo "The following changes (result of code generators and code checks) have been detected:" && git --no-pager diff && false ) # fail if Git working tree is dirty

Expand Down

0 comments on commit 5ca2b92

Please sign in to comment.