From da02b374bd41020acc3d84e1efa8972c0134f3ec Mon Sep 17 00:00:00 2001 From: Khurram Baig Date: Wed, 20 Sep 2023 19:54:23 +0530 Subject: [PATCH] Enable GolangCI Linter used in Pipeline repo --- .golangci.yml | 84 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2adab9eeb..60a16cb08 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,16 +13,94 @@ linters-settings: exclude: .errcheck.txt linters: enable: - - deadcode + - bodyclose + - containedctx + - decorder + - depguard + - dogsled + - dupword - errcheck + - errchkjson + - errname + - errorlint + - exhaustive + - goconst + - gocritic - gofmt - goimports - gomodguard - gosec - - gocritic - - revive + - gosimple + - govet + - maintidx + - makezero - misspell + - musttag + - nakedret + - nilerr + - nilnil + - noctx + - nolintlint + - nosprintfhostport + - thelper + - typecheck - unconvert + - unused + - usestdlibvars + - whitespace + disable: + - cyclop + - dupl + - exhaustruct + - forcetypeassert + - funlen + - gci + - gochecknoglobals + - gochecknoinits + - gocognit + - gocyclo + - godot + - godox + - goerr113 + - gofumpt + - gomnd + - gomoddirectives + - ireturn + - lll + - nestif + - nlreturn + - nonamedreturns + - paralleltest + - prealloc + - predeclared + - revive + - staticcheck + - stylecheck + - tagliatelle + - testpackage + - tparallel + - unparam + - varnamelen + - wastedassign + - wrapcheck + - wsl + # Enabling presets means that new linters that we automatically adopt new + # linters that augment a preset. This also opts us in for replacement linters + # when a linter is deprecated. + presets: + - bugs + - comment + - complexity + - error + - format + - import + - metalinter + - module + - performance + - sql + - style + - test + - unused issues: exclude-rules: - path: _test\.go