From f602004cd41a00d957cad81981b9d92dd810d38e Mon Sep 17 00:00:00 2001 From: justinsb Date: Sat, 29 Jul 2023 16:37:07 -0400 Subject: [PATCH] lint: Add golangci based on kubernetes/kubernetes. Adapted the "strict" settings, but removed a few exclusions that aren't relevant here (e.g. zz_generated), and removed the custom logcheck linter (as we aren't currently using structured logging). --- .golangci.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..cd1a03c --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,26 @@ +# This file configures checks that all new code for Kubernetes is meant to +# pass, in contrast to .golangci.yaml which defines checks that also the +# existing code passes. + +run: + timeout: 30m + +linters: + disable-all: false + enable: # please keep this alphabetized + - ginkgolinter + - gocritic + - govet + - ineffassign + # Should we add logcheck, for consistency with kubernetes/kubernetes? + # - logcheck + - staticcheck + - stylecheck + - unused + +linters-settings: # please keep this alphabetized + gocritic: + staticcheck: + checks: + - "all" + stylecheck: