Skip to content

Commit

Permalink
Bump up golangci-lint to v1.54.2
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
(cherry picked from commit 6e2c915)
Signed-off-by: Akhil Mohan <akhil.mohan@broadcom.com>
  • Loading branch information
ktock authored and Akhil Mohan committed Mar 1, 2024
1 parent 8d849a2 commit b16ca72
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v4
with:
version: v1.51.1
version: v1.54.2
skip-cache: true
args: --timeout=8m

Expand Down
18 changes: 18 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ issues:
- path: 'archive[\\/]tarheader[\\/]'
# conversion is necessary on Linux, unnecessary on macOS
text: "unnecessary conversion"
- linters:
- revive
text: "if-return"
- linters:
- revive
text: "empty-block"
- linters:
- revive
text: "superfluous-else"
- linters:
- revive
text: "unused-parameter"
- linters:
- revive
text: "unreachable-code"
- linters:
- revive
text: "redefines-builtin-id"

# FIXME temporarily suppress deprecation warnings for the logs package. See https://github.com/containerd/containerd/pull/9086
- text: "SA1019: log\\.(G|L|Fields|Entry|RFC3339NanoFixed|Level|TraceLevel|DebugLevel|InfoLevel|WarnLevel|ErrorLevel|FatalLevel|PanicLevel|SetLevel|GetLevel|OutputFormat|TextFormat|JSONFormat|SetFormat|WithLogger|GetLogger)"
Expand Down
3 changes: 2 additions & 1 deletion pkg/cri/sbserver/image_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ func (c *criService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*tls.C
if len(cert.Certificate) != 0 {
tlsConfig.Certificates = []tls.Certificate{cert}
}
tlsConfig.BuildNameToCertificate() //nolint:staticcheck // TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
// TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
tlsConfig.BuildNameToCertificate() //nolint:staticcheck
}

if registryTLSConfig.CAFile != "" {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cri/server/image_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ func (c *criService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*tls.C
if len(cert.Certificate) != 0 {
tlsConfig.Certificates = []tls.Certificate{cert}
}
tlsConfig.BuildNameToCertificate() //nolint:staticcheck // TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
// TODO(thaJeztah): verify if we should ignore the deprecation; see https://github.com/containerd/containerd/pull/7349/files#r990644833
tlsConfig.BuildNameToCertificate() //nolint:staticcheck
}

if registryTLSConfig.CAFile != "" {
Expand Down
1 change: 0 additions & 1 deletion remotes/docker/config/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ func parseHostsFile(baseDir string, b []byte) ([]hostConfig, error) {

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

c := struct {
Expand Down
2 changes: 1 addition & 1 deletion script/setup/install-dev-tools
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -eu -o pipefail
go install github.com/containerd/protobuild@v0.3.0
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
go install github.com/cpuguy83/go-md2man/v2@v2.0.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
go install github.com/containerd/ttrpc/cmd/protoc-gen-go-ttrpc@5cc9169d1fc1a8292866224ae09dc47827801874

0 comments on commit b16ca72

Please sign in to comment.