5
5
disable-all : true
6
6
# TODO(GODRIVER-2156): Enable all commented-out linters.
7
7
enable :
8
- - deadcode
9
8
- errcheck
10
9
# - errorlint
11
10
- goimports
@@ -18,12 +17,10 @@ linters:
18
17
- nakedret
19
18
- revive
20
19
- staticcheck
21
- - structcheck
22
20
- typecheck
23
21
- unused
24
22
- unconvert
25
23
# - unparam
26
- - varcheck
27
24
28
25
linters-settings :
29
26
errcheck :
@@ -65,15 +62,29 @@ issues:
65
62
- path : x/mongo/driver/auth/internal/awsv4
66
63
linters :
67
64
- unused
68
- - structcheck
69
- # Disable "unused" linter for "crypt.go" because the linter doesn't work correctly without
70
- # enabling CGO.
71
- - path : x/mongo/driver/crypt.go
65
+ # Disable "unused" linter for code files that depend on the "mongocrypt.MongoCrypt" type because
66
+ # the linter build doesn't work correctly with CGO enabled. As a result, all calls to a
67
+ # "mongocrypt.MongoCrypt" API appear to always panic (see mongocrypt_not_enabled.go), leading
68
+ # to confusing messages about unused code.
69
+ - path : x/mongo/driver/crypt.go|mongo/(crypt_retrievers|mongocryptd).go
72
70
linters :
73
71
- unused
74
72
# Ignore "TLS MinVersion too low", "TLS InsecureSkipVerify set true", and "Use of weak random
75
73
# number generator (math/rand instead of crypto/rand)" in tests.
76
74
- path : (.+)_test.go
77
75
text : G401|G402|G404
78
76
linters :
79
- - gosec
77
+ - gosec
78
+ # Ignore missing comments for exported variable/function/type for code in the "internal" and
79
+ # "benchmark" directories.
80
+ - path : (internal\/|benchmark\/)
81
+ text : exported (.+) should have comment( \(or a comment on this block\))? or be unexported
82
+ # Ignore missing package comments for directories that aren't frequently used by external users.
83
+ # TODO(GODRIVER-2517): Remove "mongo/testaws" and "mongo/testatlas" from the ignored paths when
84
+ # TODO we move those packages to the "cmd/" directory.
85
+ - path : (internal\/|benchmark\/|x\/|cmd\/|mongo\/integration\/|mongo\/(testaws\/|testatlas\/))
86
+ text : should have a package comment
87
+ # Disable unused linter for "golang.org/x/exp/rand" package in internal/randutil/rand.
88
+ - path : internal/randutil/rand
89
+ linters :
90
+ - unused
0 commit comments