From 3cdc4225e17f0ddee53fc3fa3c4ab7637fed4b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rams=C3=A9s=20Morales?= Date: Fri, 22 Jul 2022 12:05:42 -0700 Subject: [PATCH] Followup to "Add golangci-lint config file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addressed comments by @ldez and added `lint-fix` target. Signed-off-by: Ramsés Morales --- .golangci.yaml | 18 +++++++----------- Makefile | 8 ++++++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index c46d59e00..fb3c4cb2d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,4 +1,5 @@ run: + go: '1.17' timeout: 30m skip-files: - "^zz_generated.*" @@ -27,15 +28,10 @@ linters: linters-settings: # please keep this alphabetized staticcheck: - go: "1.17" - checks: [ - "all", - "-SA1019", # TODO(fix) Using a deprecated function, variable, constant or field - "-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed - ] + checks: + - "all" + - "-SA1019" # TODO(fix) Using a deprecated function, variable, constant or field + - "-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed stylecheck: - checks: [ - "ST1019", # Importing the same package multiple times. - ] - unused: - go: "1.17" + checks: + - "ST1019" # Importing the same package multiple times. diff --git a/Makefile b/Makefile index 34b370dae..959af8a41 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,10 @@ push-docker-release-main: $(info ETCD_VERSION: $(ETCD_VERSION)) docker push gcr.io/etcd-development/etcd:$(ETCD_VERSION) +# Recursively analyzes the tree: lint: - # Recursively analyzes the tree: - golangci-lint -v run + golangci-lint run + +# Fixes found issues, if supported by the linter: +lint-fix: + golangci-lint run --fix