Skip to content

Commit 4764d65

Browse files
authored
chore: bump golangci-lint version to v2 (#157)
Signed-off-by: chlins <[email protected]>
1 parent 28c12d6 commit 4764d65

File tree

3 files changed

+51
-37
lines changed

3 files changed

+51
-37
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fetch-depth: '0'
2222

2323
- name: Golangci lint
24-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84
24+
uses: golangci/golangci-lint-action@v7.0.0
2525
with:
26-
version: v1.54
26+
version: v2.1
2727
args: --verbose --timeout=10m

.golangci.yml

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,55 @@
1+
version: "2"
12
run:
2-
timeout: 3m
33
modules-download-mode: readonly
4-
skip-dirs:
5-
- test/mocks
6-
7-
linters-settings:
8-
gocyclo:
9-
min-complexity: 100
10-
gci:
11-
sections:
12-
- standard
13-
- default
14-
- prefix(github.com/CloudNativeAI/modctl)
15-
16-
issues:
17-
new: true
18-
exclude-rules:
19-
- linters:
20-
- staticcheck
21-
text: "SA1019:"
22-
4+
output:
5+
formats:
6+
text:
7+
path: stdout
8+
print-linter-name: true
9+
print-issued-lines: true
2310
linters:
24-
disable-all: true
11+
default: none
2512
enable:
26-
- gci
27-
- gofmt
28-
- golint
29-
- misspell
30-
- govet
13+
- errcheck
3114
- goconst
32-
- deadcode
3315
- gocyclo
16+
- govet
17+
- misspell
3418
- staticcheck
35-
- errcheck
36-
37-
output:
38-
formats:
39-
- format: colored-line-number
40-
print-issued-lines: true
41-
print-linter-name: true
19+
settings:
20+
gocyclo:
21+
min-complexity: 100
22+
exclusions:
23+
generated: lax
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- legacy
28+
- std-error-handling
29+
rules:
30+
- linters:
31+
- staticcheck
32+
text: 'SA1019:'
33+
paths:
34+
- third_party$
35+
- builtin$
36+
- examples$
37+
- test/mocks
38+
issues:
39+
new: true
40+
formatters:
41+
enable:
42+
- gci
43+
- gofmt
44+
settings:
45+
gci:
46+
sections:
47+
- standard
48+
- default
49+
- prefix(github.com/CloudNativeAI/modctl)
50+
exclusions:
51+
generated: lax
52+
paths:
53+
- third_party$
54+
- builtin$
55+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test: fmt vet ## Run unit test and display the coverage.
5959
go tool cover -func cover.out
6060

6161
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
62-
GOLANGCI_LINT_VERSION ?= v1.54.2
62+
GOLANGCI_LINT_VERSION ?= v2.1.2
6363
golangci-lint:
6464
@[ -f $(GOLANGCI_LINT) ] || { \
6565
set -e ;\

0 commit comments

Comments
 (0)