Skip to content

Commit aee3d11

Browse files
committed
Update linter version.
golangci-lint v2 uses a different syntax and has deprecated some checks. gosimple has been merged into staticcheck. typecheck is not a linter and has been removed. maligned has been deprecated. Signed-off-by: Dionna Glaze <[email protected]>
1 parent 9a86440 commit aee3d11

File tree

3 files changed

+56
-58
lines changed

3 files changed

+56
-58
lines changed

.github/workflows/linters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
steps:
1111
- uses: actions/setup-go@v2
1212
with:
13-
go-version: "1.22"
13+
go-version: "1.23"
1414
- name: Checkout code
1515
uses: actions/checkout@v2
1616
- name: Install golangci-lint
1717
run: |
1818
go version
19-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
19+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6
2020
- name: Install mockgen
2121
run: |
2222
go install github.com/golang/mock/[email protected]

.golangci.yml

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
11
# Do not delete linter settings. Linters like gocritic can be enabled on the command line.
22

3-
linters-settings:
4-
dupl:
5-
threshold: 100
6-
funlen:
7-
lines: 100
8-
statements: 50
9-
goconst:
10-
min-len: 2
11-
min-occurrences: 3
12-
gocritic:
13-
enabled-tags:
14-
- diagnostic
15-
- experimental
16-
- opinionated
17-
- performance
18-
- style
19-
disabled-checks:
20-
- dupImport # https://github.com/go-critic/go-critic/issues/845
21-
- ifElseChain
22-
- octalLiteral
23-
- paramTypeCombine
24-
- whyNoLint
25-
- wrapperFunc
26-
gofmt:
27-
simplify: false
28-
goimports:
29-
golint:
30-
min-confidence: 0
31-
govet:
32-
check-shadowing: true
33-
lll:
34-
line-length: 140
35-
maligned:
36-
suggest-new: true
37-
misspell:
38-
locale: US
39-
40-
linters:
41-
disable-all: true
3+
formatters:
424
enable:
43-
- errcheck
44-
- goconst
45-
- gocyclo
465
- gofmt
476
- goimports
48-
- gosec
49-
- govet
50-
- ineffassign
51-
- misspell
52-
- revive
53-
- staticcheck
54-
- typecheck
55-
- unconvert
56-
- unused
7+
settings:
8+
gofmt:
9+
simplify: false
5710

11+
linters:
12+
default: none
13+
enable:
14+
- dupl # style
15+
- errcheck # bugs
16+
- funlen # complexity
17+
- goconst # style
18+
- gocritic # metalinter
19+
- gocyclo # complexity
20+
- gosec # bugs
21+
- govet # bugs
22+
- ineffassign
23+
- lll # style
24+
- misspell # comment
25+
- revive # metalinter
26+
- staticcheck # metalinter
27+
- unconvert # style
28+
- unused # unused
29+
settings:
30+
dupl:
31+
threshold: 100
32+
funlen:
33+
lines: 100
34+
statements: 50
35+
goconst:
36+
min-len: 2
37+
min-occurrences: 3
38+
gocritic:
39+
enabled-tags:
40+
- diagnostic
41+
- experimental
42+
- opinionated
43+
- performance
44+
- style
45+
disabled-checks:
46+
- dupImport # https://github.com/go-critic/go-critic/issues/845
47+
- ifElseChain
48+
- octalLiteral
49+
- paramTypeCombine
50+
- whyNoLint
51+
- wrapperFunc
52+
govet:
53+
enable:
54+
- shadow
55+
lll:
56+
line-length: 140
57+
misspell:
58+
locale: US
5859

5960
issues:
6061
# max-issues-per-linter default is 50. Set to 0 to disable limit.
@@ -80,7 +81,4 @@ issues:
8081
# see it as unused
8182
- unused
8283

83-
# golangci.com configuration
84-
# https://github.com/golangci/golangci/wiki/Configuration
85-
service:
86-
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
84+
version: "2"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GOPKG += github.com/veraison/corim/extensions
1212

1313
GOLINT ?= golangci-lint
1414

15-
GOLINT_ARGS ?= run --timeout=3m -E dupl -E gocritic -E gosimple -E lll -E prealloc
15+
GOLINT_ARGS ?= run --timeout=3m -E dupl -E gocritic -E staticcheck -E lll -E prealloc
1616

1717
.PHONY: lint
1818
lint:

0 commit comments

Comments
 (0)