Skip to content

Commit 6e2c915

Browse files
committed
Bump up golangci-lint to v1.52.2
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
1 parent 57c526b commit 6e2c915

6 files changed

Lines changed: 24 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- uses: actions/checkout@v3
4545
- uses: golangci/golangci-lint-action@v3
4646
with:
47-
version: v1.51.1
47+
version: v1.52.2
4848
skip-cache: true
4949
args: --timeout=8m
5050

.golangci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ issues:
3232
- path: 'archive[\\/]tarheader[\\/]'
3333
# conversion is necessary on Linux, unnecessary on macOS
3434
text: "unnecessary conversion"
35+
- linters:
36+
- revive
37+
text: "if-return"
38+
- linters:
39+
- revive
40+
text: "empty-block"
41+
- linters:
42+
- revive
43+
text: "superfluous-else"
44+
- linters:
45+
- revive
46+
text: "unused-parameter"
47+
- linters:
48+
- revive
49+
text: "unreachable-code"
50+
- linters:
51+
- revive
52+
text: "redefines-builtin-id"
3553

3654
linters-settings:
3755
gosec:

pkg/cri/sbserver/images/image_pull.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ func (c *CRIImageService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*
361361
if len(cert.Certificate) != 0 {
362362
tlsConfig.Certificates = []tls.Certificate{cert}
363363
}
364-
tlsConfig.BuildNameToCertificate() //nolint:staticcheck // TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
364+
// TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
365+
tlsConfig.BuildNameToCertificate() //nolint:staticcheck
365366
}
366367

367368
if registryTLSConfig.CAFile != "" {

pkg/cri/server/image_pull.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ func (c *criService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*tls.C
343343
if len(cert.Certificate) != 0 {
344344
tlsConfig.Certificates = []tls.Certificate{cert}
345345
}
346-
tlsConfig.BuildNameToCertificate() //nolint:staticcheck // TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
346+
// TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
347+
tlsConfig.BuildNameToCertificate() //nolint:staticcheck
347348
}
348349

349350
if registryTLSConfig.CAFile != "" {

remotes/docker/config/hosts.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ func parseHostsFile(baseDir string, b []byte) ([]hostConfig, error) {
332332

333333
// HACK: we want to keep toml parsing structures private in this package, however go-toml ignores private embedded types.
334334
// so we remap it to a public type within the func body, so technically it's public, but not possible to import elsewhere.
335-
//nolint:unused
336335
type HostFileConfig = hostFileConfig
337336

338337
c := struct {

script/setup/install-dev-tools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -eu -o pipefail
2323
go install github.com/containerd/protobuild@v0.3.0
2424
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
2525
go install github.com/cpuguy83/go-md2man/v2@v2.0.2
26-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
26+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
2727
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
2828
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
2929
go install github.com/containerd/ttrpc/cmd/protoc-gen-go-ttrpc@5cc9169d1fc1a8292866224ae09dc47827801874

0 commit comments

Comments
 (0)