diff --git a/.golangci.yml b/.golangci.yml index f7b34bea..5b0de5bd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,32 +37,46 @@ linters-settings: block-size: 2 wsl: allow-trailing-comment: true + reassign: + patterns: + - "utilruntime.ErrorHandlers" linters: disable-all: true enable: + - asasalint - asciicheck - bidichk - bodyclose + # - canonicalheader # This is a slow linter and we don't use the net/http.Header API + - containedctx - contextcheck + - copyloopvar # - cyclop # This is equivalent to gocyclo + # - decorder # We don't want to completely restrict declaration ordering, eg it's useful to group enumeration constants + # with the type declaration # - depguard # depguard now denies by default, it should only be enabled if we actually use it - dogsled - dupl + - dupword - durationcheck - errcheck + - errchkjson - errorlint - errname - exhaustive - # - exhaustivestruct # Not recommended for general use - meant to be used only for special cases - - exportloopref + # - exhaustruct # This is too cumbersome as it requires all string, int, pointer et al fields to be initialized even when the + # type's default suffices, which is most of the time + - fatcontext # - forbidigo # We don't forbid any statements # - forcetypeassert # There are many unchecked type assertions that would be the result of a programming error so the # reasonable recourse would be to panic anyway if checked so this doesn't seem useful # - funlen # gocyclo is enabled which is generally a better metric than simply LOC. - gci - ginkgolinter + - gocheckcompilerdirectives # - gochecknoglobals # We don't want to forbid global variable constants - gochecknoinits + # - gochecksumtype # The usefulness is very narrow - gocognit - goconst - gocritic @@ -74,24 +88,30 @@ linters: - gofumpt - goheader - goimports - # - golint # Deprecated since v1.41.0 - # - gomnd # It doesn't seem useful in general to enforce constants for all numeric values # - gomoddirectives # We don't want to forbid the 'replace' directive # - gomodguard # We don't block any modules # - goprintffuncname # This doesn't seem useful at all + # - gosmopolitan # This is related to internationalization which is not a concern for us - gosec - gosimple - govet - # - ifshort # This is a style preference and doesn't seem compelling + # - grouper # Grouping of const and var declarations is handled by gofumpt + - iface - importas + - inamedparam - ineffassign - # - interfacer # Deprecated since v1.38.0 + # - interfacebloat # Don't restrict the number of interface methods + - intrange # - ireturn # The argument to always "Return Concrete Types" doesn't seem compelling. It is perfectly valid to return # an interface to avoid exposing the entire underlying struct - lll + - loggercheck + - maintidx - makezero - # - maligned # Deprecated since v1.38.0 + - mirror - misspell + # - mnd # It doesn't seem useful in general to enforce constants for all numeric values + - musttag - nakedret # - nestif # This calculates cognitive complexity but we're doing that elsewhere - nilerr @@ -99,18 +119,28 @@ linters: # - nlreturn # This is reasonable with a block-size of 2 but setting it above isn't honored # - noctx # We don't send HTTP requests - nolintlint + - nonamedreturns + # - nosprintfhostport # The use of this is very narrow # - paralleltest # Not relevant for Ginkgo UTs + - perfsprint - prealloc - predeclared - promlinter + # - protogetter # We don't use protobuf + - reassign + - recvcheck - revive # - rowserrcheck # We don't use SQL - # - scopelint # Deprecated since v1.39.0 + # - sloglint # We don't use log/slog + # - spancheck # We don't use OpenTelemetry/OpenCensus # - sqlclosecheck # We don't use SQL - staticcheck - stylecheck + - tagalign # - tagliatelle # Inconsistent with stylecheck and not as good # - tenv # Not relevant for our Ginkgo UTs + # - testableexamples # We don't need this + # - testifylint # We don't use testify - testpackage # - thelper # Not relevant for our Ginkgo UTs # - tparallel # Not relevant for our Ginkgo UTs @@ -118,11 +148,13 @@ linters: - unconvert - unparam - unused + - usestdlibvars # - varnamelen # It doesn't seem necessary to enforce a minimum variable name length - wastedassign - whitespace - wrapcheck - wsl + # - zerologlint # We use zerolog indirectly so this isn't needed issues: exclude-rules: # Separating explicit var declarations by blank lines seems excessive.