Skip to content

Commit b0cbc04

Browse files
tylerauerbeckpratap0007
authored andcommitted
cleanup: update golangci-lint to v2
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
1 parent 0fa25b1 commit b0cbc04

5 files changed

Lines changed: 475 additions & 396 deletions

File tree

.golangci.yml

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
1-
issues:
2-
exclude-rules:
3-
# Exclude some linters from running on tests files.
4-
# temporarily disabling G602 due to https://github.com/securego/gosec/issues/1005
5-
- path: _test\.go
6-
linters:
7-
- gosec
8-
exclude-dirs:
9-
- vendor
1+
version: "2"
102
run:
11-
issues-exit-code: 1
123
build-tags:
134
- e2e
14-
linters-settings:
15-
errcheck:
16-
exclude-functions:
17-
- (*github.com/tektoncd/pipeline/vendor/go.uber.org/zap.SugaredLogger).Sync
18-
- flag.Set
19-
- os.Setenv
20-
- logger.Sync
21-
- fmt.Fprintf
22-
- fmt.Fprintln
23-
- (io.Closer).Close
24-
- updateConfigMap
25-
staticcheck:
26-
checks:
27-
- '-SA1019' # ignore ClusterTask warning
5+
issues-exit-code: 1
286
linters:
297
enable:
30-
- errcheck
31-
- gofmt
32-
- goimports
33-
- gosec
34-
- gocritic
35-
- revive
36-
- misspell
37-
- unused
8+
- gocritic
9+
- gosec
10+
- misspell
11+
- revive
12+
settings:
13+
errcheck:
14+
exclude-functions:
15+
- (*github.com/tektoncd/pipeline/vendor/go.uber.org/zap.SugaredLogger).Sync
16+
- flag.Set
17+
- os.Setenv
18+
- logger.Sync
19+
- fmt.Fprintf
20+
- fmt.Fprintln
21+
- (io.Closer).Close
22+
- updateConfigMap
23+
staticcheck:
24+
checks:
25+
- -SA1019
26+
exclusions:
27+
generated: lax
28+
presets:
29+
- comments
30+
- common-false-positives
31+
- legacy
32+
- std-error-handling
33+
rules:
34+
- linters:
35+
- gosec
36+
path: _test\.go
37+
paths:
38+
- vendor
39+
- third_party$
40+
- builtin$
41+
- examples$
42+
formatters:
43+
enable:
44+
- gofmt
45+
- goimports
46+
exclusions:
47+
generated: lax
48+
paths:
49+
- vendor
50+
- third_party$
51+
- builtin$
52+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ lint: lint-go goimports lint-yaml ## run all linters
9797

9898
GOLANGCILINT = $(BIN)/golangci-lint
9999
$(BIN)/golangci-lint: ; $(info $(M) getting golangci-lint $(GOLANGCI_VERSION))
100-
cd tools; GOBIN=$(BIN) $(GO) install -mod=mod github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION)
100+
cd tools; GOBIN=$(BIN) $(GO) install -mod=mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION)
101101

102102
.PHONY: lint-go
103103
lint-go: | $(GOLANGCILINT) ; $(info $(M) running golangci-lint…) @ ## Run golangci-lint

0 commit comments

Comments
 (0)