Skip to content

Commit 6680964

Browse files
sayborasTam Mach
authored andcommitted
Migrate to golangci-lint
Signed-off-by: Tam Mach <[email protected]>
1 parent a837179 commit 6680964

34 files changed

+58
-55
lines changed

.golangci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
deadline: 2m
19+
skip-dirs:
20+
- vendor

.gometalinter.json

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ version/version.go:
5050

5151
check: ## run all linters (TODO: enable "unused", "varcheck", "ineffassign", "unconvert", "staticheck", "goimports", "structcheck")
5252
@echo "$(WHALE) $@"
53-
gometalinter --config .gometalinter.json ./...
53+
@GO111MODULE=off golangci-lint run
5454

5555
test: ## run tests, except integration test with test.short
5656
@echo "$(WHALE) $@"

blobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/docker/distribution/reference"
1212
"github.com/opencontainers/go-digest"
13-
"github.com/opencontainers/image-spec/specs-go/v1"
13+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1414
)
1515

1616
var (

cmd/registry-api-descriptor-template/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"text/template"
2222

2323
"github.com/docker/distribution/registry/api/errcode"
24-
"github.com/docker/distribution/registry/api/v2"
24+
v2 "github.com/docker/distribution/registry/api/v2"
2525
)
2626

2727
var spaceRegex = regexp.MustCompile(`\n\s*`)

manifest/manifestlist/manifestlist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/docker/distribution"
99
"github.com/docker/distribution/manifest"
1010
"github.com/opencontainers/go-digest"
11-
"github.com/opencontainers/image-spec/specs-go/v1"
11+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1212
)
1313

1414
const (

manifest/manifestlist/manifestlist_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
"github.com/docker/distribution"
10-
"github.com/opencontainers/image-spec/specs-go/v1"
10+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1111
)
1212

1313
var expectedManifestListSerialization = []byte(`{

manifest/ocischema/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/docker/distribution"
88
"github.com/docker/distribution/manifest"
99
"github.com/opencontainers/go-digest"
10-
"github.com/opencontainers/image-spec/specs-go/v1"
10+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1111
)
1212

1313
// Builder is a type for constructing manifests.

manifest/ocischema/builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/docker/distribution"
99
"github.com/opencontainers/go-digest"
10-
"github.com/opencontainers/image-spec/specs-go/v1"
10+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1111
)
1212

1313
type mockBlobService struct {

manifest/ocischema/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/docker/distribution"
99
"github.com/docker/distribution/manifest"
1010
"github.com/opencontainers/go-digest"
11-
"github.com/opencontainers/image-spec/specs-go/v1"
11+
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1212
)
1313

1414
var (

0 commit comments

Comments
 (0)