-
Notifications
You must be signed in to change notification settings - Fork 22
Upgrade go-template-utils
to v3.2.0
#106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,15 +87,15 @@ clean: | |
|
||
.PHONY: fmt-dependencies | ||
fmt-dependencies: | ||
$(call go-get-tool,github.com/daixiang0/gci@v0.2.9) | ||
$(call go-get-tool,mvdan.cc/gofumpt@v0.2.0) | ||
$(call go-get-tool,github.com/daixiang0/gci@v0.10.1) | ||
$(call go-get-tool,mvdan.cc/gofumpt@v0.5.0) | ||
|
||
# All available format: format-go format-protos format-python | ||
# Default value will run all formats, override these make target with your requirements: | ||
# eg: fmt: format-go format-protos | ||
fmt: fmt-dependencies | ||
find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gofmt -s -w | ||
find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gci -w -local "$(shell cat go.mod | head -1 | cut -d " " -f 2)" | ||
find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gci write -s standard -s default -s "prefix($(shell cat go.mod | head -1 | cut -d " " -f 2))" | ||
find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gofumpt -l -w | ||
|
||
############################################################ | ||
|
@@ -107,7 +107,7 @@ check: lint | |
|
||
.PHONY: lint-dependencies | ||
lint-dependencies: | ||
$(call go-get-tool,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2) | ||
$(call go-get-tool,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2) | ||
|
||
# All available linters: lint-dockerfiles lint-scripts lint-yaml lint-copyright-banner lint-go lint-python lint-helm lint-markdown lint-sass lint-typescript lint-protos | ||
# Default value will run all linters, override these make target with your requirements: | ||
|
@@ -119,19 +119,20 @@ lint: lint-dependencies lint-all | |
############################################################ | ||
GOSEC = $(LOCAL_BIN)/gosec | ||
KUBEBUILDER = $(LOCAL_BIN)/kubebuilder | ||
KBVERSION = 3.2.0 | ||
K8S_VERSION = 1.21.2 | ||
ENVTEST = $(LOCAL_BIN)/setup-envtest | ||
KBVERSION = 3.12.0 | ||
ENVTEST_K8S_VERSION = 1.26.x | ||
|
||
.PHONY: test | ||
test: test-dependencies | ||
KUBEBUILDER_ASSETS=$(LOCAL_BIN) go test $(TESTARGS) `go list ./... | grep -v test/e2e` | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(TESTARGS) `go list ./... | grep -v test/e2e` | ||
|
||
.PHONY: test-coverage | ||
test-coverage: TESTARGS = -json -cover -covermode=atomic -coverprofile=coverage_unit.out | ||
test-coverage: test | ||
|
||
.PHONY: test-dependencies | ||
test-dependencies: kubebuilder-dependencies kubebuilder | ||
test-dependencies: envtest kubebuilder | ||
|
||
.PHONY: kubebuilder | ||
kubebuilder: | ||
|
@@ -141,17 +142,13 @@ kubebuilder: | |
chmod +x $(KUBEBUILDER); \ | ||
fi | ||
|
||
.PHONY: kubebuilder-dependencies | ||
kubebuilder-dependencies: $(LOCAL_BIN) | ||
@if [ ! -f $(LOCAL_BIN)/etcd ] || [ ! -f $(LOCAL_BIN)/kube-apiserver ] || [ ! -f $(LOCAL_BIN)/kubectl ] || \ | ||
[ "$$($(KUBEBUILDER) version 2>/dev/null | grep -o KubeBuilderVersion:\"[0-9]*\.[0-9]\.[0-9]*\")" != "KubeBuilderVersion:\"$(KBVERSION)\"" ]; then \ | ||
echo "Installing envtest Kubebuilder assets"; \ | ||
curl -L "https://go.kubebuilder.io/test-tools/$(K8S_VERSION)/$(GOOS)/$(GOARCH)" | tar xz --strip-components=2 -C $(LOCAL_BIN); \ | ||
fi | ||
.PHONY: envtest | ||
envtest: | ||
$(call go-get-tool,sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) | ||
|
||
.PHONY: gosec | ||
gosec: | ||
$(call go-get-tool,github.com/securego/gosec/v2/cmd/gosec@v2.9.6) | ||
$(call go-get-tool,github.com/securego/gosec/v2/cmd/gosec@v2.15.0) | ||
|
||
.PHONY: gosec-scan | ||
gosec-scan: gosec | ||
|
@@ -212,7 +209,7 @@ controller-gen: ## Download controller-gen locally if necessary. | |
|
||
.PHONY: kustomize | ||
kustomize: ## Download kustomize locally if necessary. | ||
$(call go-get-tool,sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
$(call go-get-tool,sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
|
||
############################################################ | ||
# e2e test section | ||
|
@@ -282,7 +279,7 @@ e2e-dependencies: | |
|
||
.PHONY: e2e-test | ||
e2e-test: e2e-dependencies | ||
$(GINKGO) -v --fail-fast --slow-spec-threshold=10s $(E2E_TEST_ARGS) test/e2e | ||
$(GINKGO) -v --fail-fast $(E2E_TEST_ARGS) test/e2e | ||
|
||
.PHONY: e2e-test-coverage | ||
e2e-test-coverage: E2E_TEST_ARGS = --json-report=report_e2e.json --output-dir=. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
service: | ||
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo. | ||
golangci-lint-version: 1.18.x # use the fixed version to not introduce new linters unexpectedly | ||
run: | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
deadline: 20m | ||
go: '1.17' | ||
timeout: 20m | ||
|
||
# which dirs to skip: they won't be analyzed; | ||
|
@@ -80,7 +76,7 @@ linters-settings: | |
check-shadowing: false | ||
gci: | ||
sections: | ||
- prefix(open-cluster-management.io/config-policy-controller) | ||
- prefix(open-cluster-management.io/governance-policy-propagator) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😹 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah--makes me wonder whether this happens elsewhere! 😢 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably the config file I was thinking of... I need more coffee 😂 |
||
golint: | ||
# minimal confidence for issues, default is 0.8 | ||
min-confidence: 0.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I remembered there being a spot for this in a config file? But maybe that can't do the (somewhat spiffy) reading of the
go.mod
.