diff --git a/.golangci.yml b/.golangci.yml index 9c63b90b5a..f77b17e7c5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,95 +35,19 @@ linters-settings: - "github.com/onsi/gomega" - "github.com/onsi/ginkgo/v2" linters: - enable: - - asasalint - - asciicheck - - bidichk - - bodyclose - - canonicalheader - - containedctx - - contextcheck - - copyloopvar - - decorder - - dogsled - - dupword - - durationcheck - - errcheck - - errchkjson - - errname - - errorlint - - exhaustive - - fatcontext - - forbidigo - - forcetypeassert - - gci - - ginkgolinter - - gocheckcompilerdirectives - - gochecknoinits - - gochecksumtype - - goconst - - gocritic - - godot - - gofmt - - goheader - - goimports - - gomodguard - - goprintffuncname - - gosec - - gosimple - - gosmopolitan - - grouper - - importas - - inamedparam - - ineffassign - - intrange - - loggercheck - - makezero - - mirror - - misspell - - musttag - - nakedret - - nilerr - - nilnil - - noctx - - nolintlint - - nosprintfhostport - - perfsprint - - prealloc - - predeclared - - promlinter - - protogetter - - reassign - - revive - - rowserrcheck - - sloglint - - spancheck - - sqlclosecheck - - staticcheck - - stylecheck - - tagalign - - tagliatelle - - tenv - - testableexamples - - testifylint - - thelper - - tparallel - - unconvert - - unparam - - unused - - usestdlibvars - - wastedassign - - whitespace - - zerologlint + enable-all: true disable: - govet # We already run with `make verify/govet` # We do not use - cyclop # Cyclomatic complexity - depguard # We don't guard against dependencies - dupl # Tracks code duplication. Too much duplication in tests. False positives in non-tests + - execinquery # Deprecated but enabled-by-default - exhaustruct # Explicitly instantiating all structs is painful for K8s structs + - exportloopref # Deprecated but enabled-by-default - funlen # Long func names happen - gocognit # Cognitive complexity + - gocyclo # Cyclomatic complexity - gofumpt # We don't rely on gofumpt - gomnd # Magic Number Detection. Many false positives. - gomoddirectives # We need `replace` in `go.mod` @@ -134,7 +58,6 @@ linters: - mnd # Magic Number Detection. Many false positives - nestif # Don't allow too many nested if statements - nlreturn # Always have empty line before return - - nonamedreturns - testpackage # Require separate test package to catch leaky unexported dependencies - varnamelen # Long var names happen - wsl # Too strict of a whitespace linter @@ -143,4 +66,5 @@ linters: - wrapcheck # Same as err113 - gochecknoglobals # Do not allow global variables - godox # Do not allow TODOs + - nonamedreturns # Need to nolint/refactor a few places our code - paralleltest # There are many tests that aren't parallelized diff --git a/cmd/main.go b/cmd/main.go index f0fe09abbf..e41abfe773 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -18,6 +18,7 @@ package main import ( "context" + "fmt" "os" "strings" "time" @@ -107,7 +108,8 @@ func main() { klog.ErrorS(err, "failed to get version") klog.FlushAndExit(klog.ExitFlushTimeout, 1) } - klog.Info(versionInfo) + //nolint:forbidigo + fmt.Println(versionInfo) os.Exit(0) }