From b3b71924ed7c51dbc3938d55b3ae90e368b0e16f Mon Sep 17 00:00:00 2001 From: Lei Ni Date: Tue, 6 Oct 2020 14:27:27 +0800 Subject: [PATCH] Makefile: made golangci-lint-check a part of the static-check target --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2b56527b4..573a85379 100644 --- a/Makefile +++ b/Makefile @@ -258,6 +258,7 @@ tools-checkdisk: ############################################################################### CHECKED_PKGS=$(shell go list ./...) CHECKED_DIRS=$(subst $(PKGNAME), ,$(subst $(PKGNAME)/, ,$(CHECKED_PKGS))) +EXTRA_LINTERS=-E misspell -E scopelint -E interfacer .PHONY: static-check static-check: @for p in $(CHECKED_PKGS); do \ @@ -266,15 +267,16 @@ static-check: done; @for p in $(CHECKED_DIRS); do \ ineffassign $$p; \ + golangci-lint run $$p; \ + golangci-lint run $(EXTRA_LINTERS) $$p; \ done; -EXTRA_LINTERS=-E dupl -E misspell -E scopelint -E interfacer -.PHONY: golangci-lint-check -golangci-lint-check: +.PHONY: extra-static-check +extra-static-check: override EXTRA_LINTERS :=-E dupl +extra-static-check: @for p in $(CHECKED_DIRS); do \ - golangci-lint run $$p; \ - done; - @golangci-lint run $(EXTRA_LINTERS) . + golangci-lint run $(EXTRA_LINTERS) $$p; \ + done; ############################################################################### # clean