Skip to content

Commit 7b99d63

Browse files
authored
Merge pull request #14 from dmcgowan/update-lint-version
Bump golangci lint version and minimum go version
2 parents 4f0df13 + a8fbd63 commit 7b99d63

File tree

4 files changed

+44
-27
lines changed

4 files changed

+44
-27
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
cache: false # see actions/setup-go#368
3939

4040
- uses: actions/checkout@v6
41-
- uses: golangci/golangci-lint-action@v6
41+
- uses: golangci/golangci-lint-action@v9
4242
with:
43-
version: v1.61.0
43+
version: v2.6.2
4444
skip-cache: true
4545
args: --timeout=5m
4646

.golangci.yml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
1+
version: "2"
12
linters:
23
enable:
34
- copyloopvar
4-
- gofmt
5-
- goimports
5+
- dupword
66
- gosec
7-
- ineffassign
87
- misspell
98
- nolintlint
109
- revive
11-
- staticcheck
12-
- tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17
1310
- unconvert
14-
- unused
15-
- govet
16-
- dupword # Checks for duplicate words in the source code
1711
disable:
1812
- errcheck
19-
20-
run:
21-
timeout: 5m
22-
23-
issues:
24-
exclude-dirs:
25-
- api
26-
- cluster
27-
- design
28-
- docs
29-
- docs/man
30-
- releases
31-
- reports
32-
- test # e2e scripts
13+
exclusions:
14+
generated: lax
15+
presets:
16+
- comments
17+
- common-false-positives
18+
- legacy
19+
- std-error-handling
20+
paths:
21+
- api
22+
- cluster
23+
- design
24+
- docs
25+
- docs/man
26+
- releases
27+
- reports
28+
- test
29+
- third_party$
30+
- builtin$
31+
- examples$
32+
formatters:
33+
enable:
34+
- gofmt
35+
- goimports
36+
exclusions:
37+
generated: lax
38+
paths:
39+
- api
40+
- cluster
41+
- design
42+
- docs
43+
- docs/man
44+
- releases
45+
- reports
46+
- test
47+
- third_party$
48+
- builtin$
49+
- examples$

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/containerd/plugin
22

3-
go 1.20
3+
go 1.22
44

55
require github.com/opencontainers/image-spec v1.1.0
66

plugin_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,15 @@ func testPlugin(t Type, id string, i interface{}, err error) *Plugin {
520520
func BenchmarkGraph(b *testing.B) {
521521
register := testRegistry()
522522
b.ResetTimer()
523-
for i := 0; i < b.N; i++ {
523+
for range b.N {
524524
register.Graph(mockPluginFilter)
525525
}
526526
}
527527

528528
func BenchmarkUnique(b *testing.B) {
529529
register := testRegistry()
530530
b.ResetTimer()
531-
for i := 0; i < b.N; i++ {
531+
for range b.N {
532532
checkUnique(register, &Registration{
533533
Type: InternalPlugin,
534534
ID: "new",

0 commit comments

Comments
 (0)