Skip to content

Commit dd6bc26

Browse files
committed
chore: update golangci
1 parent 72b214f commit dd6bc26

File tree

6 files changed

+199
-122
lines changed

6 files changed

+199
-122
lines changed
Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,25 @@
11
name: golangci-lint
22
on:
3-
pull_request:
43
push:
54
branches:
65
- v3
6+
pull_request:
77

88
permissions:
99
contents: read
10-
pull-requests: read
10+
# Optional: allow read access to pull requests. Use with `only-new-issues` option.
11+
# pull-requests: read
1112

1213
jobs:
1314
golangci:
1415
name: lint
1516
runs-on: ubuntu-latest
1617
steps:
17-
- uses: actions/checkout@v3
18-
19-
- uses: actions/setup-go@v4
18+
- uses: actions/checkout@v5
19+
- uses: actions/setup-go@v6
2020
with:
21-
go-version: "1.23"
22-
cache: false
23-
21+
go-version: "1.25.3"
2422
- name: golangci-lint
25-
uses: golangci/golangci-lint-action@v3
23+
uses: golangci/golangci-lint-action@v8
2624
with:
27-
# Require: The version of golangci-lint to use.
28-
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
29-
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
30-
version: v1.61
31-
32-
# Optional: working directory, useful for monorepos
33-
# working-directory: somedir
34-
35-
# Optional: golangci-lint command line arguments.
36-
#
37-
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
38-
# The location of the configuration file can be changed by using `--config=`
39-
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
40-
41-
# Optional: show only new issues if it's a pull request. The default value is `false`.
42-
only-new-issues: true
43-
44-
# Optional: if set to true, then all caching functionality will be completely disabled,
45-
# takes precedence over all other caching options.
46-
# skip-cache: true
47-
48-
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
49-
skip-pkg-cache: true
50-
51-
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
52-
skip-build-cache: true
53-
54-
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
55-
# install-mode: "goinstall"
25+
version: v2.5

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: golang:1.23
1+
image: golang:1.25
22

33
stages:
44
- test

.golangci.bck.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
run:
2+
timeout: 3m
3+
go: "1.23"
4+
5+
# This file contains only configs which differ from defaults.
6+
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
7+
linters-settings:
8+
cyclop:
9+
max-complexity: 30
10+
package-average: 10.0
11+
12+
errcheck:
13+
check-type-assertions: true
14+
15+
gocritic:
16+
settings:
17+
captLocal:
18+
paramsOnly: false
19+
underef:
20+
skipRecvDeref: false
21+
22+
gomodguard:
23+
blocked:
24+
modules:
25+
- github.com/golang/protobuf:
26+
recommendations:
27+
- google.golang.org/protobuf
28+
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
29+
- github.com/satori/go.uuid:
30+
recommendations:
31+
- github.com/google/uuid
32+
reason: "satori's package is not maintained"
33+
- github.com/gofrs/uuid:
34+
recommendations:
35+
- github.com/google/uuid
36+
reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw"
37+
38+
govet:
39+
enable-all: true
40+
disable:
41+
- fieldalignment
42+
43+
settings:
44+
shadow:
45+
strict: true
46+
47+
nakedret:
48+
max-func-lines: 0
49+
50+
nolintlint:
51+
allow-no-explanation: [funlen, gocognit, lll]
52+
require-explanation: false
53+
require-specific: true
54+
55+
rowserrcheck:
56+
packages:
57+
- github.com/jmoiron/sqlx
58+
59+
tenv:
60+
all: true
61+
62+
linters:
63+
disable-all: true
64+
enable:
65+
- errcheck
66+
- gosimple
67+
- govet
68+
- ineffassign
69+
- staticcheck
70+
- typecheck
71+
- unused
72+
- asciicheck
73+
- bidichk
74+
- bodyclose
75+
- contextcheck
76+
- dupl
77+
- dupword
78+
- durationcheck
79+
- errname
80+
- errorlint
81+
- exhaustive
82+
- gocritic
83+
- goimports
84+
- gomoddirectives
85+
- gomodguard
86+
- goprintffuncname
87+
- gosec
88+
- makezero
89+
- mirror
90+
- nakedret
91+
- nilerr
92+
- nilnil
93+
- noctx
94+
- nolintlint
95+
- nonamedreturns
96+
- nosprintfhostport
97+
- predeclared
98+
- promlinter
99+
- revive
100+
- rowserrcheck
101+
- sqlclosecheck
102+
- stylecheck
103+
- tenv
104+
- thelper
105+
- tparallel
106+
- unconvert
107+
- unparam
108+
- usestdlibvars
109+
- wastedassign
110+
- whitespace

.golangci.yml

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,9 @@
1+
version: "2"
12
run:
2-
timeout: 3m
3-
go: "1.23"
4-
5-
# This file contains only configs which differ from defaults.
6-
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
7-
linters-settings:
8-
cyclop:
9-
max-complexity: 30
10-
package-average: 10.0
11-
12-
errcheck:
13-
check-type-assertions: true
14-
15-
gocritic:
16-
settings:
17-
captLocal:
18-
paramsOnly: false
19-
underef:
20-
skipRecvDeref: false
21-
22-
gomodguard:
23-
blocked:
24-
modules:
25-
- github.com/golang/protobuf:
26-
recommendations:
27-
- google.golang.org/protobuf
28-
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
29-
- github.com/satori/go.uuid:
30-
recommendations:
31-
- github.com/google/uuid
32-
reason: "satori's package is not maintained"
33-
- github.com/gofrs/uuid:
34-
recommendations:
35-
- github.com/google/uuid
36-
reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw"
37-
38-
govet:
39-
enable-all: true
40-
disable:
41-
- fieldalignment
42-
43-
settings:
44-
shadow:
45-
strict: true
46-
47-
nakedret:
48-
max-func-lines: 0
49-
50-
nolintlint:
51-
allow-no-explanation: [funlen, gocognit, lll]
52-
require-explanation: false
53-
require-specific: true
54-
55-
rowserrcheck:
56-
packages:
57-
- github.com/jmoiron/sqlx
58-
59-
tenv:
60-
all: true
61-
3+
go: "1.25"
624
linters:
63-
disable-all: true
5+
default: none
646
enable:
65-
- errcheck
66-
- gosimple
67-
- govet
68-
- ineffassign
69-
- staticcheck
70-
- typecheck
71-
- unused
727
- asciicheck
738
- bidichk
749
- bodyclose
@@ -80,17 +15,17 @@ linters:
8015
- errorlint
8116
- exhaustive
8217
- gocritic
83-
- goimports
8418
- gomoddirectives
8519
- gomodguard
8620
- goprintffuncname
8721
- gosec
22+
- govet
23+
- ineffassign
8824
- makezero
8925
- mirror
9026
- nakedret
9127
- nilerr
9228
- nilnil
93-
- noctx
9429
- nolintlint
9530
- nonamedreturns
9631
- nosprintfhostport
@@ -99,12 +34,77 @@ linters:
9934
- revive
10035
- rowserrcheck
10136
- sqlclosecheck
102-
- stylecheck
103-
- tenv
10437
- thelper
10538
- tparallel
10639
- unconvert
10740
- unparam
41+
- unused
10842
- usestdlibvars
10943
- wastedassign
11044
- whitespace
45+
settings:
46+
cyclop:
47+
max-complexity: 30
48+
package-average: 10
49+
errcheck:
50+
check-type-assertions: true
51+
gocritic:
52+
settings:
53+
captLocal:
54+
paramsOnly: false
55+
underef:
56+
skipRecvDeref: false
57+
gomodguard:
58+
blocked:
59+
modules:
60+
- github.com/golang/protobuf:
61+
recommendations:
62+
- google.golang.org/protobuf
63+
reason: see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules
64+
- github.com/satori/go.uuid:
65+
recommendations:
66+
- github.com/google/uuid
67+
reason: satori's package is not maintained
68+
- github.com/gofrs/uuid:
69+
recommendations:
70+
- github.com/google/uuid
71+
reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw"
72+
govet:
73+
disable:
74+
- fieldalignment
75+
enable-all: true
76+
settings:
77+
shadow:
78+
strict: true
79+
nakedret:
80+
max-func-lines: 0
81+
nolintlint:
82+
require-explanation: false
83+
require-specific: true
84+
allow-no-explanation:
85+
- funlen
86+
- gocognit
87+
- lll
88+
rowserrcheck:
89+
packages:
90+
- github.com/jmoiron/sqlx
91+
exclusions:
92+
generated: lax
93+
presets:
94+
- comments
95+
- common-false-positives
96+
- legacy
97+
- std-error-handling
98+
paths:
99+
- third_party$
100+
- builtin$
101+
- examples$
102+
formatters:
103+
enable:
104+
- goimports
105+
exclusions:
106+
generated: lax
107+
paths:
108+
- third_party$
109+
- builtin$
110+
- examples$

appveyor.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ clone_folder: c:\GOPATH\src\github.com\errata-ai\vale
44
environment:
55
GOPATH: c:\GOPATH
66
GOROOT: C:\go
7-
GOVERSION: 1.23.0
7+
GOVERSION: 1.25.3
88
# tree-sitter
99
CGO_ENABLED: 1
1010
CC: C:\msys64\mingw64\bin\gcc.exe
@@ -13,9 +13,6 @@ init:
1313
install:
1414
- set PATH=%GOPATH%\bin;c:\go\bin;C:\Ruby24\bin;%cd%;%PATH%
1515

16-
- rmdir C:\go /s /q
17-
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.zip
18-
- 7z x go%GOVERSION%.windows-amd64.zip -y -oC:\ > NUL
1916
- go version
2017
- go env
2118

0 commit comments

Comments
 (0)