Skip to content

Commit b0a6a55

Browse files
authored
Add fmt, vet, and precheck targets to Makefile for better CI and code quality (#4182)
vAdd fmt, vet, and precheck targets to Makefile for better CI and code quality - Add mt target to run go fmt for code formatting. - Add �et target to run go vet for static analysis. - Add precheck target to run fmt, vet, lint, and test in one command. - Update help section to document new targets. - These changes improve developer experience and make it easier to maintain code quality in CI. Signed-off-by: jinronga <1460595002@qq.com>
1 parent d32cf54 commit b0a6a55

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,20 @@ clean:
346346
@rm -rf bin .go .cache
347347
.PHONY: clean
348348

349+
fmt:
350+
@echo "Begin to go fmt."
351+
@go fmt ${PKG_LIST}
352+
.PHONY: fmt
353+
354+
vet:
355+
@echo "Begin to go vet."
356+
@go vet ${PKG_LIST}
357+
.PHONY: vet
358+
359+
precheck: fmt vet lint test
360+
@echo "All checks passed."
361+
.PHONY: precheck
362+
349363
help:
350364
@echo "make build-dirs prepare required folders for build"
351365
@echo "make docker-build build dragonfly image"
@@ -390,3 +404,6 @@ help:
390404
@echo "make swag generate swagger api docs"
391405
@echo "make changelog generate CHANGELOG.md"
392406
@echo "make clean clean"
407+
@echo "make fmt run go fmt"
408+
@echo "make vet run go vet"
409+
@echo "make precheck run fmt, vet, lint, and test"

0 commit comments

Comments
 (0)