Skip to content

Commit 46e1f4e

Browse files
jholdstockJoeGruffins
authored andcommitted
build: Update golangci-lint to v2.0.2 (#3241)
Various changes in this new major version, including a new config file format: - gofmt and goimports are now categorized as formatters (instead of linters) and are moved to their own section. - The functionality of gosimple has been bundled into staticcheck. Only the gosimple behaviour is enabled (prefix "S1") and all other staticcheck behaviour is disabled. - typecheck is now always on and cannot be independently enabled/disabled.
1 parent 90f9f00 commit 46e1f4e

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
go: ['1.22', '1.23']
11+
go: ['1.23', '1.24']
1212
steps:
1313
- uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 #v1.4.3
1414
with:
@@ -28,7 +28,7 @@ jobs:
2828
- name: restore timestamps
2929
run: git restore-mtime
3030
- name: Install Linters
31-
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.2"
31+
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.2"
3232
- name: Use test and module cache
3333
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
3434
with:

.golangci.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1+
version: "2"
12
run:
2-
deadline: 10m
3-
4-
output:
5-
formats: colored-line-number
6-
3+
timeout: 10m
74
linters:
8-
disable-all: true
5+
default: none
96
enable:
107
- asciicheck
118
- bidichk
129
- durationcheck
13-
- gofmt
14-
- goimports
15-
- gosimple
1610
- govet
1711
- grouper
1812
- ineffassign
@@ -21,6 +15,20 @@ linters:
2115
- reassign
2216
- rowserrcheck
2317
- sqlclosecheck
18+
- staticcheck
2419
- tparallel
25-
- typecheck
2620
- unconvert
21+
settings:
22+
staticcheck:
23+
checks:
24+
- S1*
25+
exclusions:
26+
paths:
27+
- docs/examples
28+
formatters:
29+
enable:
30+
- gofmt
31+
- goimports
32+
exclusions:
33+
paths:
34+
- docs/examples

0 commit comments

Comments
 (0)