Skip to content

Commit f3ca8e0

Browse files
committed
Bump golangci-lint
1 parent d530f53 commit f3ca8e0

27 files changed

+173
-103
lines changed

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: golangci/golangci-lint-action@v4
3030
with:
3131
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
32-
version: v1.57.2
32+
version: v2.0.2
3333

3434
editorconfig:
3535
name: EditorConfig

.golangci.yaml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1+
version: "2"
12
run:
2-
timeout: 5m
33
build-tags:
44
- e2e
55
- mage
66
- ignored
7-
87
linters:
9-
disable-all: false
10-
presets:
11-
- bugs
12-
- unused
13-
- complexity
14-
- format
15-
- performance
16-
- style
17-
enable:
18-
- gci
8+
default: all
199
disable:
20-
- paralleltest
21-
- nlreturn
22-
- wsl
10+
- containedctx
11+
- depguard
12+
- exhaustruct
2313
- godox
2414
- ireturn
15+
- nlreturn
16+
- paralleltest
2517
- varnamelen
26-
- exhaustruct
27-
- depguard
28-
- containedctx # TODO: consider removing this
29-
30-
issues:
31-
exclude-rules:
32-
- path: _test\.go
33-
linters:
34-
- wrapcheck
35-
36-
linters-settings:
37-
wrapcheck:
38-
ignorePackageGlobs:
39-
- github.com/openshift-knative/hack/*
40-
gomoddirectives:
41-
# List of allowed `replace` directives. Default is empty.
42-
replace-allow-list: []
18+
- wsl
19+
settings:
20+
wrapcheck:
21+
ignore-package-globs:
22+
- github.com/openshift-knative/hack/*
23+
exclusions:
24+
generated: lax
25+
presets:
26+
- comments
27+
- common-false-positives
28+
- legacy
29+
rules:
30+
- linters:
31+
- wrapcheck
32+
path: _test\.go
33+
formatters:
34+
enable:
35+
- gci
36+
- gofmt
37+
- gofumpt
38+
- goimports
39+
exclusions:
40+
generated: lax

build/Magefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func init() { //nolint:gochecknoinits
3232
Resolver: git.NewVersionResolver(),
3333
},
3434
Artifacts: []config.Artifact{bin},
35-
Checks: []config.Task{checks.GolangCiLint(withVersion("v1.57.2"))},
35+
Checks: []config.Task{checks.GolangCiLint(withVersion("v2.0.2"))},
3636
})
3737
}
3838

build/go.mod

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

3-
go 1.22.9
3+
go 1.24.0
44

55
require (
66
github.com/openshift-knative/deviate v0.0.0

build/go.sum

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

go.mod

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

3-
go 1.22.9
3+
go 1.24.0
44

55
require (
66
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2

go.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
go 1.22.9
1+
go 1.24.0
22

33
use (
44
.

pkg/errors/wrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ func Is(err, target error) bool {
2323

2424
// New returns an error that formats as the given text.
2525
func New(text string) error {
26-
return errors.New(text) //nolint:goerr113
26+
return errors.New(text) //nolint:err113
2727
}

pkg/git/auth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import (
1111

1212
func authentication(remote git.Remote) (ssh.AuthMethod, error) { //nolint:ireturn
1313
if url.IsHTTP(remote.URL) {
14-
return nil, nil
14+
// The auth isn't required for getting HTTP remote from GH
15+
return nil, nil //nolint:nilnil
1516
}
1617
if sshagent.Available() {
1718
user := ""

pkg/git/checkout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (o onGoingCheckout) As(branch string) error {
8989

9090
func (o onGoingCheckout) OntoWorkspace(filters files.Filters) error {
9191
coOpts := &gitv5.CloneOptions{
92-
URL: "file://" + o.repo.Project.Path,
92+
URL: "file://" + o.repo.Path,
9393
ReferenceName: plumbing.NewBranchReferenceName(o.branch),
9494
SingleBranch: true,
9595
Depth: 1,

0 commit comments

Comments
 (0)