Skip to content

Commit 2860f92

Browse files
committed
Revert "Remove custom lint rules"
This reverts commit 146eb76.
1 parent 487d42b commit 2860f92

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed

Diff for: .golangci.yml

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# v1.60.1
2+
# Please don't remove the first line. It uses in CI to determine the golangci version
3+
run:
4+
timeout: 5m
5+
6+
issues:
7+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
8+
max-issues-per-linter: 0
9+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
10+
max-same-issues: 0
11+
12+
# 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 added
14+
# to the exclude-rules below
15+
exclude-use-default: false
16+
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+
- canonicalheader
23+
- cyclop
24+
- dupl
25+
- gocognit
26+
- funlen
27+
- lll
28+
- forcetypeassert
29+
- path: js\/modules\/k6\/html\/.*\.go
30+
text: "exported: exported "
31+
linters:
32+
- revive
33+
- path: js\/modules\/k6\/http\/.*_test\.go
34+
linters:
35+
# k6/http module's tests are quite complex because they often have several nested levels.
36+
# The module is in maintenance mode, so we don't intend to port the tests to a parallel version.
37+
- paralleltest
38+
- tparallel
39+
- linters:
40+
- forbidigo
41+
text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden'
42+
43+
linters-settings:
44+
exhaustive:
45+
default-signifies-exhaustive: true
46+
cyclop:
47+
max-complexity: 25
48+
dupl:
49+
threshold: 150
50+
goconst:
51+
min-len: 10
52+
min-occurrences: 4
53+
funlen:
54+
lines: 80
55+
statements: 60
56+
forbidigo:
57+
forbid:
58+
- '^(fmt\\.Print(|f|ln)|print|println)$'
59+
# Forbid everything in os, except os.Signal and os.SyscalError
60+
- '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?'
61+
# Forbid everything in syscall except the uppercase constants
62+
- '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?'
63+
- '^logrus\.Logger$'
64+
65+
linters:
66+
disable-all: true
67+
enable:
68+
- asasalint
69+
- asciicheck
70+
- bidichk
71+
- bodyclose
72+
- canonicalheader
73+
- contextcheck
74+
- cyclop
75+
- dogsled
76+
- dupl
77+
- durationcheck
78+
- errcheck
79+
- errchkjson
80+
- errname
81+
- errorlint
82+
- exhaustive
83+
- exportloopref
84+
- fatcontext
85+
- forbidigo
86+
- forcetypeassert
87+
- funlen
88+
- gocheckcompilerdirectives
89+
- gochecknoglobals
90+
- gocognit
91+
- goconst
92+
- gocritic
93+
- gofmt
94+
- gofumpt
95+
- goimports
96+
- gomoddirectives
97+
- goprintffuncname
98+
- gosec
99+
- gosimple
100+
- govet
101+
- importas
102+
- ineffassign
103+
- interfacebloat
104+
- lll
105+
- makezero
106+
- misspell
107+
- nakedret
108+
- nestif
109+
- nilerr
110+
- nilnil
111+
- noctx
112+
- nolintlint
113+
- nosprintfhostport
114+
- paralleltest
115+
- prealloc
116+
- predeclared
117+
- promlinter
118+
- revive
119+
- reassign
120+
- rowserrcheck
121+
- sqlclosecheck
122+
- staticcheck
123+
- stylecheck
124+
- tenv
125+
- tparallel
126+
- typecheck
127+
- unconvert
128+
- unparam
129+
- unused
130+
- usestdlibvars
131+
- wastedassign
132+
- whitespace
133+
fast: false

0 commit comments

Comments
 (0)