Skip to content

Commit 24400eb

Browse files
committed
copy k6 golangci-lint configuration with some omissions
1 parent cc74509 commit 24400eb

File tree

1 file changed

+78
-52
lines changed

1 file changed

+78
-52
lines changed

.golangci.yml

+78-52
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# v1.43.0
1+
# v1.60.1
22
# Please don't remove the first line. It uses in CI to determine the golangci version
33
run:
4-
deadline: 5m
4+
timeout: 5m
55

66
issues:
77
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
@@ -10,33 +10,15 @@ issues:
1010
max-same-issues: 0
1111

1212
# We want to try and improve the comments in the k6 codebase, so individual
13-
# non-golint items from the default exclusion list will gradually be addded
13+
# non-golint items from the default exclusion list will gradually be added
1414
# to the exclude-rules below
1515
exclude-use-default: false
1616

17-
exclude-rules:
18-
# Exclude duplicate code and function length and complexity checking in test
19-
# files (due to common repeats and long functions in test code)
20-
- path: _(test|gen)\.go
21-
linters:
22-
- cyclop
23-
- dupl
24-
- gocognit
25-
- funlen
26-
- lll
27-
- linters:
28-
- paralleltest # false positive: https://github.com/kunwardeep/paralleltest/issues/8.
29-
text: "does not use range value in test Run"
30-
3117
linters-settings:
3218
exhaustive:
3319
default-signifies-exhaustive: true
34-
govet:
35-
check-shadowing: true
3620
cyclop:
3721
max-complexity: 25
38-
maligned:
39-
suggest-new: true
4022
dupl:
4123
threshold: 150
4224
goconst:
@@ -45,37 +27,81 @@ linters-settings:
4527
funlen:
4628
lines: 80
4729
statements: 60
48-
goheader:
49-
template-path: ".license-template"
50-
values:
51-
const:
52-
year: "2022"
53-
regexp:
54-
year-range: (\d\d\d\d|{{year}})
30+
forbidigo:
31+
forbid:
32+
- '^(fmt\\.Print(|f|ln)|print|println)$'
33+
# Forbid everything in os, except os.Signal and os.SyscalError
34+
- '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?'
35+
# Forbid everything in syscall except the uppercase constants
36+
- '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?'
37+
- '^logrus\.Logger$'
5538

5639
linters:
57-
enable-all: true
58-
disable:
59-
- nlreturn
60-
- gci
61-
- gochecknoinits
62-
- godot
63-
- godox
64-
- gomodguard
65-
- testpackage
66-
- wsl
67-
- gomnd
68-
- goerr113 # most of the errors here are meant for humans
69-
- goheader
70-
- exhaustivestruct
71-
- thelper
72-
- gocyclo # replaced by cyclop since it also calculates the package complexity
73-
- maligned # replaced by govet 'fieldalignment'
74-
- interfacer # deprecated
75-
- scopelint # deprecated, replaced by exportloopref
76-
- wrapcheck # a little bit too much for k6, maybe after https://github.com/tomarrell/wrapcheck/issues/2 is fixed
77-
- golint # this linter is deprecated
78-
- varnamelen # disabled before the final decision in (https://github.com/grafana/k6/pull/2323)
79-
- ireturn
80-
- tagliatelle
40+
disable-all: true
41+
enable:
42+
- asasalint
43+
- asciicheck
44+
- bidichk
45+
- bodyclose
46+
- canonicalheader
47+
- contextcheck
48+
- cyclop
49+
- dogsled
50+
- dupl
51+
- durationcheck
52+
- errcheck
53+
- errchkjson
54+
- errname
55+
- errorlint
56+
- exhaustive
57+
- exportloopref
58+
- fatcontext
59+
- forbidigo
60+
- forcetypeassert
61+
- funlen
62+
- gocheckcompilerdirectives
63+
- gochecknoglobals
64+
- gocognit
65+
- goconst
66+
- gocritic
67+
- gofmt
68+
- gofumpt
69+
- goimports
70+
- gomoddirectives
71+
- goprintffuncname
72+
- gosec
73+
- gosimple
74+
- govet
75+
- importas
76+
- ineffassign
77+
- interfacebloat
78+
- lll
79+
- makezero
80+
- misspell
81+
- nakedret
82+
- nestif
83+
- nilerr
84+
- nilnil
85+
- noctx
86+
- nolintlint
87+
- nosprintfhostport
88+
- paralleltest
89+
- prealloc
90+
- predeclared
91+
- promlinter
92+
- revive
93+
- reassign
94+
- rowserrcheck
95+
- sqlclosecheck
96+
- staticcheck
97+
- stylecheck
98+
- tenv
99+
- tparallel
100+
- typecheck
101+
- unconvert
102+
- unparam
103+
- unused
104+
- usestdlibvars
105+
- wastedassign
106+
- whitespace
81107
fast: false

0 commit comments

Comments
 (0)