From 11d91304189a8706ccb91bbfe51d4e86649fefb7 Mon Sep 17 00:00:00 2001 From: KonradStaniec Date: Wed, 20 Nov 2024 12:44:29 +0100 Subject: [PATCH] fix linter file --- .golangci.yml | 63 ++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 891b3fd6d..430555e3d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,7 @@ run: timeout: 5m + +linters: disable-all: true enable: - asasalint @@ -8,96 +10,69 @@ run: - bodyclose - containedctx - contextcheck - - cyclop - decorder - - depguard - dogsled - - dupl - durationcheck - errcheck - errchkjson - errname - errorlint - - execinquery - exhaustive - - exhaustivestruct - - exhaustruct - - exportloopref - forbidigo - forcetypeassert - - funlen - - gci - - gochecknoglobals - - gochecknoinits - - gocognit - goconst - gocritic - gocyclo - - godot - - godox - - goerr113 - - gofumpt - goheader - - golint - - gomnd - - gomoddirectives - gomodguard - goprintffuncname - - gosec - gosimple - govet - grouper - - ifshort - importas - ineffassign - - interfacebloat - - interfacer - - ireturn - - lll - loggercheck - maintidx - makezero - - maligned - misspell - nakedret - - nestif - nilerr - - nilnil - - nlreturn +# - nlreturn # Style wise I personally like this one, todo(lazar): unlax at somepoint, good practice - noctx - - nolintlint - nonamedreturns - - nosnakecase - nosprintfhostport - paralleltest - - prealloc - - predeclared - - promlinter - reassign - revive - rowserrcheck - - scopelint - sqlclosecheck - staticcheck - - structcheck - stylecheck - - tagliatelle - tenv - testableexamples - - testpackage - - thelper - tparallel - typecheck - unconvert - unparam - - unused - usestdlibvars - - varcheck - - varnamelen + - unused - wastedassign - whitespace - - wrapcheck - - wsl +# - wrapcheck # we really should be using this, lax for now todo(lazar): unlax at somepoint, good practice issues: max-same-issues: 0 + # Default: https://golangci-lint.run/usage/false-positives/#default-exclusions + exclude-dirs: + - e2etest + exclude-rules: + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - gocyclo + - errcheck + - dupl + - gosec + - path-except: _test\.go + linters: + - forbidigo