diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8b85fc0e..e7d78b350 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v3 - uses: golangci/golangci-lint-action@v3 with: - version: v1.51.1 + version: v1.52.2 skip-cache: true args: --timeout=8m diff --git a/.golangci.yml b/.golangci.yml index e52c4ffb9..fec369f6d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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" linters-settings: gosec: diff --git a/pkg/cri/sbserver/images/image_pull.go b/pkg/cri/sbserver/images/image_pull.go index 84483b120..0cb32185c 100644 --- a/pkg/cri/sbserver/images/image_pull.go +++ b/pkg/cri/sbserver/images/image_pull.go @@ -361,7 +361,8 @@ func (c *CRIImageService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (* 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 != "" { diff --git a/pkg/cri/server/image_pull.go b/pkg/cri/server/image_pull.go index 909514fe8..79ab554a0 100644 --- a/pkg/cri/server/image_pull.go +++ b/pkg/cri/server/image_pull.go @@ -343,7 +343,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 != "" { diff --git a/remotes/docker/config/hosts.go b/remotes/docker/config/hosts.go index aa8ea959e..135b100fb 100644 --- a/remotes/docker/config/hosts.go +++ b/remotes/docker/config/hosts.go @@ -332,7 +332,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 { diff --git a/script/setup/install-dev-tools b/script/setup/install-dev-tools index b070a50e8..9e1e9a132 100755 --- a/script/setup/install-dev-tools +++ b/script/setup/install-dev-tools @@ -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.52.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