Skip to content

Commit f3e148b

Browse files
Merge pull request #3411 from mxpv/linter
Switch from gometalinter to golangci-lint
2 parents adb8b02 + ef7f46e commit f3e148b

15 files changed

Lines changed: 34 additions & 37 deletions

File tree

.golangci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
linters:
2+
enable:
3+
- structcheck
4+
- varcheck
5+
- staticcheck
6+
- unconvert
7+
- gofmt
8+
- goimports
9+
- golint
10+
- ineffassign
11+
- vet
12+
- unused
13+
- misspell
14+
disable:
15+
- errcheck
16+
17+
run:
18+
skip-dirs:
19+
- api
20+
- design
21+
- docs

.gometalinter.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ all: binaries
121121

122122
check: proto-fmt ## run all linters
123123
@echo "$(WHALE) $@"
124-
gometalinter --config .gometalinter.json ./...
124+
golangci-lint run
125125

126126
ci: check binaries checkprotos coverage coverage-integration ## to be used by the CI
127127

cmd/containerd-shim-runc-v1/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package main
2020

2121
import (
22-
"github.com/containerd/containerd/runtime/v2/runc/v1"
22+
v1 "github.com/containerd/containerd/runtime/v2/runc/v1"
2323
"github.com/containerd/containerd/runtime/v2/shim"
2424
)
2525

cmd/containerd-shim-runc-v2/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package main
2020

2121
import (
22-
"github.com/containerd/containerd/runtime/v2/runc/v2"
22+
v2 "github.com/containerd/containerd/runtime/v2/runc/v2"
2323
"github.com/containerd/containerd/runtime/v2/shim"
2424
)
2525

cmd/ctr/commands/events/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var Command = cli.Command{
4747
var e *events.Envelope
4848
select {
4949
case e = <-eventsCh:
50-
case err, open = <-errCh:
50+
case err = <-errCh:
5151
return err
5252
}
5353
if e != nil {

cmd/ctr/commands/plugins/plugins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/containerd/containerd/api/types"
2828
"github.com/containerd/containerd/cmd/ctr/commands"
2929
"github.com/containerd/containerd/platforms"
30-
"github.com/opencontainers/image-spec/specs-go/v1"
30+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
3131
"github.com/urfave/cli"
3232
"google.golang.org/grpc/codes"
3333
)

images/archive/reference.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func familiarizeReference(ref string) (string, error) {
9191
func ociReferenceName(name string) string {
9292
// OCI defines the reference name as only a tag excluding the
9393
// repository. The containerd annotation contains the full image name
94-
// since the tag is insufficent for correctly naming and referring to an
94+
// since the tag is insufficient for correctly naming and referring to an
9595
// image
9696
var ociRef string
9797
if spec, err := reference.Parse(name); err == nil {

pkg/progress/escape.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ package progress
1919
const (
2020
escape = "\x1b"
2121
reset = escape + "[0m"
22-
red = escape + "[31m" // nolint: staticcheck, varcheck
22+
red = escape + "[31m" // nolint: deadcode, varcheck, unused
2323
green = escape + "[32m"
2424
)

runtime/v2/binary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
8787
defer f.Close()
8888
if _, err := io.Copy(os.Stderr, f); err != nil {
8989
// When using a multi-container shim the 2nd to Nth container in the
90-
// shim will not have a seperate log pipe. Ignore the failure log
90+
// shim will not have a separate log pipe. Ignore the failure log
9191
// message here when the shim connect times out.
9292
if !os.IsNotExist(errors.Cause(err)) {
9393
log.G(ctx).WithError(err).Error("copy shim log")

0 commit comments

Comments
 (0)