Skip to content

Commit e703e64

Browse files
authoredDec 19, 2024··
Added a verify rule to Makefile to check for fmt, linting and generate errors (#122)
1 parent 2c80f45 commit e703e64

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ code-generator:
6969
fmt: ## Run go fmt against code.
7070
go fmt ./...
7171

72+
.PHONY: fmt-verify
73+
fmt-verify:
74+
@out=`gofmt -w -l -d $$(find . -name '*.go')`; \
75+
if [ -n "$$out" ]; then \
76+
echo "$$out"; \
77+
exit 1; \
78+
fi
79+
7280
.PHONY: vet
7381
vet: ## Run go vet against code.
7482
go vet ./...
@@ -90,6 +98,14 @@ lint: golangci-lint ## Run golangci-lint linter
9098
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
9199
$(GOLANGCI_LINT) run --fix
92100

101+
.PHONY: ci-lint
102+
ci-lint: golangci-lint
103+
$(GOLANGCI_LINT) run --timeout 15m0s
104+
105+
.PHONY: verify
106+
verify: vet fmt-verify ci-lint manifests generate
107+
git --no-pager diff --exit-code config api client-go
108+
93109
##@ Build
94110

95111
.PHONY: build

0 commit comments

Comments
 (0)
Please sign in to comment.