From 502879405f422b3aa287bf564f203773ed6cb422 Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Thu, 21 Sep 2023 15:08:42 +0800 Subject: [PATCH] *: lint_pass should use global golangci.yaml Disable failed linters and enable it by #16610. Signed-off-by: Wei Fu --- Makefile | 13 ++----------- scripts/test.sh | 42 ++---------------------------------------- tools/.golangci.yaml | 10 +++++----- 3 files changed, 9 insertions(+), 56 deletions(-) diff --git a/Makefile b/Makefile index 249fad34f..902214e3f 100644 --- a/Makefile +++ b/Makefile @@ -85,14 +85,9 @@ fix-bom: verify-dep: PASSES="dep" ./scripts/test.sh -# TODO: https://github.com/etcd-io/etcd/issues/16610 -# -# The golangci-lint doesn't verify sub modules. Before #16610 fixed, verify-lint -# still depends on legacy {ineffassign,nakedret,unparam,...}_pass. These X_pass -# will be removed when the golangci-lint covers all the sub modules. .PHONY: verify-lint -verify-lint: verify-golangcilint - golangci-lint run --config tools/.golangci.yaml +verify-lint: + PASSES="lint" ./scripts/test.sh .PHONY: fix-lint fix-lint: @@ -150,10 +145,6 @@ verify-yamllint: verify-govet-shadow: PASSES="govet_shadow" ./scripts/test.sh -.PHONY: verify-golangcilint -verify-golangcilint: - PASSES="golangcilint" ./scripts/test.sh - YAMLFMT_VERSION = $(shell cd tools/mod && go list -m -f '{{.Version}}' github.com/google/yamlfmt) .PHONY: fix-yamllint diff --git a/scripts/test.sh b/scripts/test.sh index f79268f97..ded0d8184 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -425,46 +425,8 @@ function unparam_pass { run_for_modules generic_checker run_go_tool "mvdan.cc/unparam" } -function golangcilint_pass { - local tmp_lintyaml - tmp_lintyaml=$(mktemp -t 'tmp_golangcilint_XXX.yaml') - - # shellcheck disable=SC2064 - trap "rm ${tmp_lintyaml}; trap - RETURN" RETURN - - # TODO: Copy the tools/.golangci.yaml and run the linters for which we have - # already fixed. It should be removed when closes #16610. - cat > "${tmp_lintyaml}" <