Skip to content

Commit 8272d1f

Browse files
authored
chore(lint): version bump to v2.0.1 (#176)
1 parent d04ab70 commit 8272d1f

File tree

3 files changed

+111
-104
lines changed

3 files changed

+111
-104
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
- name: go mod tidy check
1515
uses: katexochen/go-tidy-check@v2
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v6
17+
uses: golangci/golangci-lint-action@v7
1818
with:
19-
version: v1.64.5 # LINT_VERSION: update version in other places
19+
version: v2.0.1 # LINT_VERSION: update version in other places
2020
- id: govulncheck
2121
uses: golang/govulncheck-action@v1

.golangci.yml

Lines changed: 108 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: "2"
12
linters:
23
enable:
34
- asasalint
@@ -14,7 +15,6 @@ linters:
1415
- dupword
1516
- durationcheck
1617
- err113
17-
- errcheck
1818
- errchkjson
1919
- errname
2020
- errorlint
@@ -33,21 +33,15 @@ linters:
3333
- gocritic
3434
- gocyclo
3535
- godox
36-
- gofmt
37-
- gofumpt
3836
- goheader
39-
- goimports
4037
- gomoddirectives
4138
- gomodguard
4239
- goprintffuncname
4340
- gosec
44-
- gosimple
45-
- govet
4641
- grouper
4742
- iface
4843
- importas
4944
- inamedparam
50-
- ineffassign
5145
- interfacebloat
5246
- intrange
5347
- lll
@@ -79,111 +73,124 @@ linters:
7973
- sloglint
8074
- sqlclosecheck
8175
- staticcheck
82-
- stylecheck
8376
- tagalign
8477
- tagliatelle
8578
- testifylint
8679
- testpackage
8780
- thelper
8881
- tparallel
89-
- typecheck
9082
- unconvert
9183
- unparam
92-
- unused
9384
- usestdlibvars
9485
- usetesting
95-
- wastedassign
86+
- wastedassign
9687
- whitespace
9788
- wrapcheck
9889
- wsl
9990
- zerologlint
100-
101-
linters-settings:
102-
errcheck:
103-
check-blank: true
104-
disable-default-exclusions: true
105-
errchkjson:
106-
report-no-exported: true
107-
dupl:
108-
threshold: 120
109-
tagliatelle:
110-
case:
111-
use-field-name: true
112-
rules:
113-
yaml: kebab
114-
forbidigo:
115-
forbid:
116-
- 'time\.Sleep*(# Do not sleep)?'
117-
- 'panic*(# Do not panic)?'
118-
- 'os\.Exit*(# Do not exit)?'
119-
- p: ^fmt\.Print*$
120-
msg: Do not commit print statements.
121-
funlen:
122-
ignore-comments: true
123-
gocognit:
124-
min-complexity: 20
125-
gocyclo:
126-
min-complexity: 20
127-
goconst:
128-
numbers: true
129-
min-occurrences: 3
130-
grouper:
131-
import-require-single-import: true
132-
iface:
133-
enable:
134-
- identical
135-
- unused
136-
testifylint:
137-
enable-all: true
138-
unparam:
139-
check-exported: true
140-
nolintlint:
141-
require-explanation: true
142-
maintidx:
143-
under: 40
144-
misspell:
145-
locale: US
146-
govet:
147-
enable-all: true
148-
disable:
149-
- fieldalignment
150-
lll:
151-
line-length: 100
152-
tab-width: 1
153-
nlreturn:
154-
block-size: 5
155-
goimports:
156-
local-prefixes: github.com/vladopajic/go-test-coverage/v2
157-
wsl:
158-
force-err-cuddling: true
159-
160-
issues:
161-
exclude-rules:
162-
- path: _test\.go
163-
linters:
164-
- funlen ## Function length is okay due to many tests cases
165-
- wrapcheck ## No need to check wrapping errors in tests
166-
- maintidx ## Test are okay to be long
167-
168-
- linters:
169-
- gosec
170-
path: _test\.go
171-
text: "G404" ## allow weak rand in tests
172-
173-
- path: export_test\.go
174-
linters:
175-
- revive ## Disabling linter because we intentionally want to use unexported types in tests
176-
- gochecknoglobals ## Global values are useful when exporting functions
177-
178-
- path: _test\.go ## Enable dot-imports in tests
179-
text: "dot-imports"
180-
linters:
181-
- revive
182-
183-
- text: "require-error" ## Option to disable this error does not work
184-
linters:
185-
- testifylint
186-
187-
- text: "do not define dynamic errors" ## dynamic errors are okay is this is simple tool
188-
linters:
189-
- err113
91+
settings:
92+
dupl:
93+
threshold: 120
94+
errcheck:
95+
disable-default-exclusions: true
96+
check-blank: true
97+
errchkjson:
98+
report-no-exported: true
99+
forbidigo:
100+
forbid:
101+
- pattern: time\.Sleep*(# Do not sleep)?
102+
- pattern: panic*(# Do not panic)?
103+
- pattern: os\.Exit*(# Do not exit)?
104+
- pattern: ^fmt\.Print*$
105+
msg: Do not commit print statements.
106+
funlen:
107+
ignore-comments: true
108+
gocognit:
109+
min-complexity: 20
110+
goconst:
111+
min-occurrences: 3
112+
numbers: true
113+
gocyclo:
114+
min-complexity: 20
115+
govet:
116+
disable:
117+
- fieldalignment
118+
enable-all: true
119+
grouper:
120+
import-require-single-import: true
121+
iface:
122+
enable:
123+
- identical
124+
- unused
125+
lll:
126+
line-length: 100
127+
tab-width: 1
128+
maintidx:
129+
under: 40
130+
misspell:
131+
locale: US
132+
nlreturn:
133+
block-size: 5
134+
nolintlint:
135+
require-explanation: true
136+
tagliatelle:
137+
case:
138+
rules:
139+
yaml: kebab
140+
use-field-name: true
141+
testifylint:
142+
enable-all: true
143+
unparam:
144+
check-exported: true
145+
wsl:
146+
force-err-cuddling: true
147+
exclusions:
148+
generated: lax
149+
presets:
150+
- comments
151+
- common-false-positives
152+
- legacy
153+
- std-error-handling
154+
rules:
155+
- linters:
156+
- funlen ## Function length is okay due to many tests cases
157+
- maintidx ## No need to check wrapping errors in tests
158+
- wrapcheck ## Test are okay to be long
159+
path: _test\.go
160+
- linters:
161+
- gosec
162+
path: _test\.go
163+
text: G404 ## allow weak rand in tests
164+
- linters:
165+
- gochecknoglobals ## Global values are useful when exporting functions
166+
- revive ## Disabling linter because we intentionally want to use unexported types in tests
167+
path: export_test\.go
168+
- linters:
169+
- revive
170+
path: _test\.go
171+
text: dot-imports ## Enable dot-imports in tests
172+
- linters:
173+
- testifylint
174+
text: require-error
175+
- linters:
176+
- err113
177+
text: do not define dynamic errors ## dynamic errors are okay is this is simple tool
178+
paths:
179+
- third_party$
180+
- builtin$
181+
- examples$
182+
formatters:
183+
enable:
184+
- gofmt
185+
- gofumpt
186+
- goimports
187+
settings:
188+
goimports:
189+
local-prefixes:
190+
- github.com/vladopajic/go-test-coverage/v2
191+
exclusions:
192+
generated: lax
193+
paths:
194+
- third_party$
195+
- builtin$
196+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GO ?= go
22
GOBIN ?= $$($(GO) env GOPATH)/bin
33
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
4-
GOLANGCI_LINT_VERSION ?= v1.64.5 # LINT_VERSION: update version in other places
4+
GOLANGCI_LINT_VERSION ?= v2.0.1 # LINT_VERSION: update version in other places
55

66
# Code tidy
77
.PHONY: tidy

0 commit comments

Comments
 (0)