From 765982e86abf43c97182cdc197d53c78b518d1eb Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sat, 22 Apr 2023 20:03:57 +0800 Subject: [PATCH] Chore: add new `lint-fix` for Makefile --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e546d99..a343aad 100644 --- a/Makefile +++ b/Makefile @@ -130,12 +130,15 @@ all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST) releases: $(gz_releases) $(zip_releases) -lint: - GOOS=darwin golangci-lint run ./... - GOOS=windows golangci-lint run ./... - GOOS=linux golangci-lint run ./... - GOOS=freebsd golangci-lint run ./... - GOOS=openbsd golangci-lint run ./... +LINT_OS_LIST := darwin windows linux freebsd openbsd + +lint: $(foreach os,$(LINT_OS_LIST),$(os)-lint) +%-lint: + GOOS=$* golangci-lint run ./... + +lint-fix: $(foreach os,$(LINT_OS_LIST),$(os)-lint-fix) +%-lint-fix: + GOOS=$* golangci-lint run --fix ./... clean: rm $(BINDIR)/*