Skip to content

Commit f21ba23

Browse files
committed
client: silence flaky nolintlint at the grpc.Dial directive
The //nolint:staticcheck directive at client.go:35 has been intermittently flagged as unused by nolintlint when running on the windows-2025 lint job, even though the underlying code, the grpc dependency, and the directive itself are unchanged. The behaviour is sensitive to golangci-lint's analysis cache state: master has been passing this check, but small changes elsewhere in the module can shift the analyzer scheduling enough that staticcheck's SA1019 deprecation finding disappears from the input to nolintlint, which then reports the directive as unused. Add nolintlint to the directive so it self-suppresses, and document the reason inline so the next person who looks at this knows why. The grpc.Dial -> grpc.NewClient migration is a separate concern that would remove the need for the directive entirely; out of scope here. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
1 parent d720cd4 commit f21ba23

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/driver/external/client/client.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ func NewDriverClient(socketPath string, logger *logrus.Logger) (*DriverClient, e
3232
grpc.WithTransportCredentials(insecure.NewCredentials()),
3333
}
3434

35-
//nolint:staticcheck // grpc.Dial is used for compatibility reasons
35+
// grpc.Dial (deprecated in favour of grpc.NewClient) is intentional here
36+
// for compatibility. Suppress both the staticcheck SA1019 deprecation and
37+
// nolintlint's unused-directive check: which staticcheck issues survive
38+
// past golangci-lint's filter pipeline depends on cache state, so the
39+
// SA1019 finding can be either kept or dropped before nolintlint inspects
40+
// it. Silencing nolintlint avoids a flaky lint failure across platforms.
41+
//nolint:staticcheck,nolintlint // grpc.Dial used for compatibility reasons
3642
conn, err := grpc.Dial("unix://"+socketPath, opts...)
3743
if err != nil {
3844
logger.Errorf("failed to dial gRPC driver client connection: %v", err)

0 commit comments

Comments
 (0)