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
@@ -19,12 +18,10 @@ linters:
19
18
- prealloc
20
19
- revive
21
20
- staticcheck
22
- - structcheck
23
21
- typecheck
24
22
- unused
25
23
- unconvert
26
24
- unparam
27
- - varcheck
28
25
29
26
linters-settings :
30
27
errcheck :
@@ -92,10 +89,11 @@ issues:
92
89
- path : x/mongo/driver/auth/internal/awsv4
93
90
linters :
94
91
- unused
95
- - structcheck
96
- # Disable "unused" linter for "crypt.go" because the linter doesn't work correctly without
97
- # enabling CGO.
98
- - path : x/mongo/driver/crypt.go
92
+ # Disable "unused" linter for code files that depend on the "mongocrypt.MongoCrypt" type because
93
+ # the linter build doesn't work correctly with CGO enabled. As a result, all calls to a
94
+ # "mongocrypt.MongoCrypt" API appear to always panic (see mongocrypt_not_enabled.go), leading
95
+ # to confusing messages about unused code.
96
+ - path : x/mongo/driver/crypt.go|mongo/(crypt_retrievers|mongocryptd).go
99
97
linters :
100
98
- unused
101
99
# Ignore "TLS MinVersion too low", "TLS InsecureSkipVerify set true", and "Use of weak random
@@ -108,3 +106,12 @@ issues:
108
106
# "benchmark" directories.
109
107
- path : (internal\/|benchmark\/)
110
108
text : exported (.+) should have comment( \(or a comment on this block\))? or be unexported
109
+ # Ignore missing package comments for directories that aren't frequently used by external users.
110
+ # TODO(GODRIVER-2517): Remove "mongo/testaws" and "mongo/testatlas" from the ignored paths when
111
+ # TODO we move those packages to the "cmd/" directory.
112
+ - path : (internal\/|benchmark\/|x\/|cmd\/|mongo\/integration\/|mongo\/(testaws\/|testatlas\/))
113
+ text : should have a package comment
114
+ # Disable unused linter for "golang.org/x/exp/rand" package in internal/randutil/rand.
115
+ - path : internal/randutil/rand
116
+ linters :
117
+ - unused
0 commit comments