Skip to content

Commit 0464841

Browse files
committed
chore: update golangci
1 parent 4c30a6d commit 0464841

File tree

4 files changed

+103
-93
lines changed

4 files changed

+103
-93
lines changed

.github/workflows/linters.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
go-version: stable
1717

1818
- name: Run linter
19-
uses: golangci/golangci-lint-action@v6.5.2 # Action page: <https://github.com/golangci/golangci-lint-action>
19+
uses: golangci/golangci-lint-action@v7 # Action page: <https://github.com/golangci/golangci-lint-action>
2020
with:
21-
version: v1.64 # without patch version
2221
only-new-issues: false # show only new issues if it's a pull request
2322
args: --timeout=10m --build-tags=race ./...

.golangci.yml

Lines changed: 87 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,91 @@
1-
# Documentation: <https://github.com/golangci/golangci-lint#config-file>
2-
1+
version: "2"
32
run:
4-
timeout: 1m
53
allow-parallel-runners: true
6-
7-
linters-settings:
8-
wsl:
9-
allow-assign-and-anything: true
10-
gocyclo:
11-
min-complexity: 15
12-
godot:
13-
scope: declarations
14-
capital: true
15-
dupl:
16-
threshold: 100
17-
goconst:
18-
min-len: 2
19-
min-occurrences: 3
20-
misspell:
21-
locale: US
22-
lll:
23-
line-length: 120
24-
prealloc:
25-
simple: true
26-
range-loops: true
27-
for-loops: true
28-
nolintlint:
29-
require-specific: true
30-
31-
linters: # All available linters list: <https://golangci-lint.run/usage/linters/>
32-
disable-all: true
4+
linters:
5+
default: none
336
enable:
34-
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
35-
- bodyclose # Checks whether HTTP response body is closed successfully
36-
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
37-
- dupl # Tool for code clone detection
38-
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
39-
- errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13
40-
- exhaustive # check exhaustiveness of enum switch statements
41-
- copyloopvar # Checks for using loop variables in function literals
42-
- gochecknoglobals # Checks that no globals are present in Go code
43-
- gochecknoinits # Checks that no init functions are present in Go code
44-
- gocognit # Computes and checks the cognitive complexity of functions
45-
- goconst # Finds repeated strings that could be replaced by a constant
46-
- gocritic # The most opinionated Go source code linter
47-
- gocyclo # Computes and checks the cyclomatic complexity of functions
48-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
49-
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
7+
- asciicheck
8+
- bodyclose
9+
- copyloopvar
10+
- dogsled
11+
- dupl
12+
- errcheck
13+
- errorlint
14+
- exhaustive
15+
- gochecknoglobals
16+
- gochecknoinits
17+
- gocognit
18+
- goconst
19+
- gocritic
20+
- gocyclo
21+
- goprintffuncname
22+
- gosec
23+
- govet
24+
- ineffassign
25+
- misspell
26+
- nakedret
27+
- noctx
28+
- nolintlint
29+
- prealloc
5030
- revive
51-
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
52-
- gosec # Inspects source code for security problems
53-
- gosimple # Linter for Go source code that specializes in simplifying a code
54-
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
55-
- ineffassign # Detects when assignments to existing variables are not used
56-
- misspell # Finds commonly misspelled English words in comments
57-
- nakedret # Finds naked returns in functions greater than a specified function length
58-
- noctx # finds sending http request without context.Context
59-
- nolintlint # Reports ill-formed or insufficient nolint directives
60-
- prealloc # Finds slice declarations that could potentially be preallocated
61-
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
62-
- stylecheck # Stylecheck is a replacement for golint
63-
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
64-
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
65-
- unconvert # Remove unnecessary type conversions
66-
- unparam # Reports unused function parameters
67-
- unused # Checks Go code for unused constants, variables, functions and types
68-
- whitespace # Tool for detection of leading and trailing whitespace
69-
70-
issues:
71-
exclude-dirs:
72-
- .github
73-
- .git
74-
exclude-rules:
75-
- path: _test\.go
76-
linters:
77-
- dupl
78-
- funlen
79-
- scopelint
80-
- gocognit
31+
- staticcheck
32+
- tparallel
33+
- unconvert
34+
- unparam
35+
- unused
36+
- whitespace
37+
settings:
38+
dupl:
39+
threshold: 100
40+
goconst:
41+
min-len: 2
42+
min-occurrences: 3
43+
gocyclo:
44+
min-complexity: 15
45+
godot:
46+
scope: declarations
47+
capital: true
48+
lll:
49+
line-length: 120
50+
misspell:
51+
locale: US
52+
nolintlint:
53+
require-specific: true
54+
prealloc:
55+
simple: true
56+
range-loops: true
57+
for-loops: true
58+
wsl:
59+
allow-assign-and-anything: true
60+
exclusions:
61+
generated: lax
62+
presets:
63+
- comments
64+
- common-false-positives
65+
- legacy
66+
- std-error-handling
67+
rules:
68+
- linters:
69+
- dupl
70+
- funlen
71+
- gocognit
72+
- scopelint
73+
path: _test\.go
74+
paths:
75+
- .github
76+
- .git
77+
- third_party$
78+
- builtin$
79+
- examples$
80+
formatters:
81+
enable:
82+
- gofmt
83+
- goimports
84+
exclusions:
85+
generated: lax
86+
paths:
87+
- .github
88+
- .git
89+
- third_party$
90+
- builtin$
91+
- examples$

tests/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ replace github.com/roadrunner-server/headers/v5 => ../
1818

1919
require (
2020
github.com/beorn7/perks v1.0.1 // indirect
21-
github.com/caddyserver/certmagic v0.22.0 // indirect
21+
github.com/caddyserver/certmagic v0.22.2 // indirect
2222
github.com/caddyserver/zerossl v0.1.3 // indirect
2323
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2424
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -38,18 +38,18 @@ require (
3838
github.com/mattn/go-colorable v0.1.14 // indirect
3939
github.com/mattn/go-isatty v0.0.20 // indirect
4040
github.com/mholt/acmez v1.2.0 // indirect
41-
github.com/mholt/acmez/v3 v3.1.0 // indirect
41+
github.com/mholt/acmez/v3 v3.1.1 // indirect
4242
github.com/miekg/dns v1.1.64 // indirect
4343
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
44-
github.com/onsi/ginkgo/v2 v2.23.2 // indirect
44+
github.com/onsi/ginkgo/v2 v2.23.3 // indirect
4545
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
4646
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
4747
github.com/prometheus/client_golang v1.21.1 // indirect
4848
github.com/prometheus/client_model v0.6.1 // indirect
4949
github.com/prometheus/common v0.63.0 // indirect
5050
github.com/prometheus/procfs v0.16.0 // indirect
5151
github.com/quic-go/qpack v0.5.1 // indirect
52-
github.com/quic-go/quic-go v0.50.0 // indirect
52+
github.com/quic-go/quic-go v0.50.1 // indirect
5353
github.com/roadrunner-server/api/v4 v4.18.1 // indirect
5454
github.com/roadrunner-server/context v1.0.2 // indirect
5555
github.com/roadrunner-server/errors v1.4.1 // indirect
@@ -89,7 +89,7 @@ require (
8989
golang.org/x/sys v0.31.0 // indirect
9090
golang.org/x/text v0.23.0 // indirect
9191
golang.org/x/tools v0.31.0 // indirect
92-
google.golang.org/protobuf v1.36.5 // indirect
92+
google.golang.org/protobuf v1.36.6 // indirect
9393
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
9494
gopkg.in/yaml.v3 v3.0.1 // indirect
9595
)

tests/go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
22
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
3-
github.com/caddyserver/certmagic v0.22.0 h1:hi2skv2jouUw9uQUEyYSTTmqPZPHgf61dOANSIVCLOw=
4-
github.com/caddyserver/certmagic v0.22.0/go.mod h1:Vc0msarAPhOagbDc/SU6M2zbzdwVuZ0lkTh2EqtH4vs=
3+
github.com/caddyserver/certmagic v0.22.2 h1:qzZURXlrxwR5m25/jpvVeEyJHeJJMvAwe5zlMufOTQk=
4+
github.com/caddyserver/certmagic v0.22.2/go.mod h1:hbqE7BnkjhX5IJiFslPmrSeobSeZvI6ux8tyxhsd6qs=
55
github.com/caddyserver/zerossl v0.1.3 h1:onS+pxp3M8HnHpN5MMbOMyNjmTheJyWRaZYwn+YTAyA=
66
github.com/caddyserver/zerossl v0.1.3/go.mod h1:CxA0acn7oEGO6//4rtrRjYgEoa4MFw/XofZnrYwGqG4=
77
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -52,14 +52,14 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
5252
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
5353
github.com/mholt/acmez v1.2.0 h1:1hhLxSgY5FvH5HCnGUuwbKY2VQVo8IU7rxXKSnZ7F30=
5454
github.com/mholt/acmez v1.2.0/go.mod h1:VT9YwH1xgNX1kmYY89gY8xPJC84BFAisjo8Egigt4kE=
55-
github.com/mholt/acmez/v3 v3.1.0 h1:RlOx2SSZ8dIAM5GfkMe8TdaxjjkiHTGorlMUt8GeMzg=
56-
github.com/mholt/acmez/v3 v3.1.0/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
55+
github.com/mholt/acmez/v3 v3.1.1 h1:Jh+9uKHkPxUJdxM16q5mOr+G2V0aqkuFtNA28ihCxhQ=
56+
github.com/mholt/acmez/v3 v3.1.1/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
5757
github.com/miekg/dns v1.1.64 h1:wuZgD9wwCE6XMT05UU/mlSko71eRSXEAm2EbjQXLKnQ=
5858
github.com/miekg/dns v1.1.64/go.mod h1:Dzw9769uoKVaLuODMDZz9M6ynFU6Em65csPuoi8G0ck=
5959
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
6060
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
61-
github.com/onsi/ginkgo/v2 v2.23.2 h1:LYLd7Wz401p0N7xR8y7WL6D2QZwKpbirDg0EVIvzvMM=
62-
github.com/onsi/ginkgo/v2 v2.23.2/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
61+
github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0=
62+
github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
6363
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
6464
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
6565
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
@@ -76,8 +76,8 @@ github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2b
7676
github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg=
7777
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
7878
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
79-
github.com/quic-go/quic-go v0.50.0 h1:3H/ld1pa3CYhkcc20TPIyG1bNsdhn9qZBGN3b9/UyUo=
80-
github.com/quic-go/quic-go v0.50.0/go.mod h1:Vim6OmUvlYdwBhXP9ZVrtGmCMWa3wEqhq3NgYrI8b4E=
79+
github.com/quic-go/quic-go v0.50.1 h1:unsgjFIUqW8a2oopkY7YNONpV1gYND6Nt9hnt1PN94Q=
80+
github.com/quic-go/quic-go v0.50.1/go.mod h1:Vim6OmUvlYdwBhXP9ZVrtGmCMWa3wEqhq3NgYrI8b4E=
8181
github.com/roadrunner-server/api/v4 v4.18.1 h1:IA01DjK7wPXkSAUc0Bg2d3hmc/XMI0DYn0BKbBju9bI=
8282
github.com/roadrunner-server/api/v4 v4.18.1/go.mod h1:VdCLIpnjKFHNspqRlu5zfPvrDS9eLR7fYy5K9HYKNkE=
8383
github.com/roadrunner-server/config/v5 v5.1.6 h1:S0taNW9AyDK8P66/nLVO/jIq7VZmTNfDKkf6UZKdKjs=
@@ -183,8 +183,8 @@ golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
183183
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
184184
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
185185
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
186-
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
187-
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
186+
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
187+
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
188188
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
189189
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
190190
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 commit comments

Comments
 (0)