22
22
# By default, it isn't set.
23
23
modules-download-mode : readonly
24
24
25
+ issues :
25
26
# Enables skipping of directories:
26
27
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
27
28
# Default: true
28
- skip -dirs-use-default : false
29
+ exclude -dirs-use-default : false
29
30
30
- # note: examples will be currently omitted by the build tag
31
- skip-dirs :
32
- - platforms/opencv
31
+ # note: folders/files can not be excluded from "typecheck" anymore since v1.61.0
33
32
34
33
linters :
35
34
# currently active linters:
36
35
#
37
- # INFO [lintersdb] Active 64 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck decorder depguard dogsled dupword durationcheck
38
- # errcheck errchkjson errorlint exportloopref forcetypeassert gci gocheckcompilerdirectives gochecknoinits gochecksumtype gocritic gofmt gofumpt goimports
39
- # gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper inamedparam ineffassign lll makezero mirror misspell musttag nakedret nilerr nilnil
40
- # noctx nolintlint nonamedreturns nosprintfhostport perfsprint prealloc predeclared protogetter reassign revive sloglint staticcheck tagalign tenv
41
- # testableexamples testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign]
36
+ # INFO [lintersdb] Active 67 linters: [asasalint asciicheck bidichk bodyclose canonicalheader containedctx
37
+ # contextcheck decorder depguard dogsled dupword durationcheck errcheck errchkjson errorlint fatcontext
38
+ # forcetypeassert gci gocheckcompilerdirectives gochecknoinits gochecksumtype gocritic gofmt gofumpt goimports
39
+ # gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper inamedparam ineffassign lll makezero
40
+ # mirror misspell mnd musttag nakedret nilerr nilnil noctx nolintlint nonamedreturns nosprintfhostport perfsprint
41
+ # prealloc predeclared protogetter reassign revive sloglint spancheck staticcheck tagalign tenv testableexamples
42
+ # testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign]
42
43
43
44
enable-all : true
44
45
45
46
# https://golangci-lint.run/usage/linters/#enabled-by-default
46
47
# note: typecheck can not be disabled, it is used to check code compilation
47
48
disable :
48
- # deprecated
49
- - deadcode # deprecated
50
- - exhaustivestruct # deprecated
51
- - golint # deprecated
52
- - ifshort # deprecated
53
- - interfacer # deprecated
54
- - maligned # deprecated
55
- - nosnakecase # deprecated
56
- - scopelint # deprecated
57
- - structcheck # deprecated
58
- - varcheck # deprecated
49
+ # deprecated:
50
+ - exportloopref # Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar
51
+ - gomnd # The linter has been renamed. Replaced by mnd.
52
+ # not used for this go version: none
59
53
# not used for any reason
54
+ - err113 # not used (we allow error creation at return statement)
60
55
- execinquery # not needed (no sql)
61
56
- exhaustive # not used (we allow incomplete usage of enum switch, e.g. with default case)
62
57
- forbidigo # not used (we allow print statements)
63
58
- ginkgolinter # not needed (enforces standards of using ginkgo and gomega)
64
59
- gochecknoglobals # not used (we allow definition of unexposed variables at top level)
65
60
- godot # not used (seems to be counting peas)
66
61
- godox # not used (we have many TODOs, so not useful)
67
- - goerr113 # not used (we allow error creation at return statement)
68
62
- gosmopolitan # not needed (report i18n/l10n anti-patterns)
69
63
- importas # not needed (there is no alias rule at the moment)
70
64
- ireturn # not used (we allow return interfaces)
@@ -86,9 +80,10 @@ linters:
86
80
- goconst # useful (reduce bugs)
87
81
- gocyclo # useful with some tweeks (better understandable code)
88
82
- goheader # useful, if we introduce a common header (e.g. for copyright)
89
- - gomnd # useful with some exclusions for existing code (e.g. mavlink.go)
90
83
- interfacebloat # useful with some exclusions at usage of external packages
84
+ - intrange # introduced with go 1.22, will simplify the range syntax
91
85
- maintidx # useful with some tweeks (better understandable code), maybe use instead "gocyclo", "gocognit" , "cyclop"
86
+ - mnd # useful with some exclusions for existing code (e.g. mavlink.go)
92
87
- nestif # useful (reduce bugs, simplify code, better understandable code)
93
88
- nlreturn # more common style, but could become annoying
94
89
- stylecheck # useful with some tweaking (e.g. underscores in names should be allowed - we use it for constants retrieved from C/C++)
0 commit comments