Skip to content

Commit 11f12ab

Browse files
committed
switch golangci-lint to v2 for go v1.25 support and migrate lint config
go v1.25 is now required by the dependencies we pull in (coder/v2). - pin golangci-lint to v2.4.0 in CI - update .golangci.yml to v2 schema (default none, formatter config, settings move) - bump golangci-lint-action to v8 so v2.x installs correctly
1 parent 729cfa3 commit 11f12ab

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ jobs:
3636
- run: go build -v .
3737

3838
- name: Run linters
39-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
39+
uses: golangci/golangci-lint-action@v8
4040
with:
41-
version: latest
41+
# Pin to v2.4.0+ because it is the first golangci-lint release that
42+
# supports Go 1.25.
43+
version: v2.4.0
4244

4345
generate:
4446
runs-on: ubuntu-latest
@@ -112,7 +114,7 @@ jobs:
112114

113115
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
114116
with:
115-
go-version: "1.25.6"
117+
go-version-file: "go.mod"
116118
id: go
117119

118120
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2

.golangci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
version: "2"
2+
13
# Visit https://golangci-lint.run/ for usage documentation and information on
24
# other useful linters
35
issues:
46
max-issues-per-linter: 0
57
max-same-issues: 0
68

79
linters:
8-
disable-all: true
10+
default: none
911
enable:
1012
- durationcheck
1113
- errcheck
1214
- forcetypeassert
1315
- godot
14-
- gofmt
15-
- gosimple
1616
- govet
1717
- ineffassign
1818
- makezero
@@ -25,9 +25,12 @@ linters:
2525
- unparam
2626
- unused
2727
- usetesting
28+
settings:
29+
paralleltest:
30+
# Terraform acceptance subtests all share a Coder instance, and cannot run
31+
# in parallel.
32+
ignore-missing-subtests: true
2833

29-
linters-settings:
30-
paralleltest:
31-
# Terraform acceptance subtests all share a Coder instance, and cannot run
32-
# in parallel.
33-
ignore-missing-subtests: true
34+
formatters:
35+
enable:
36+
- gofmt

0 commit comments

Comments
 (0)