-
Notifications
You must be signed in to change notification settings - Fork 8
/
.golangci.yml
110 lines (103 loc) · 3.33 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# v1.55.2
# Please don't remove the first line. It is used in CI to determine the golangci version
run:
deadline: 5m
issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
# We want to try and improve the comments in the k6 codebase, so individual
# non-golint items from the default exclusion list will gradually be added
# to the exclude-rules below
exclude-use-default: false
exclude-rules:
# Exclude duplicate code and function length and complexity checking in api
- path: pkg/api/(.+)\.go
linters:
- dupl
- funlen
# Exclude duplicate code and function length and complexity checking in test
# files (due to common repeats and long functions in test code)
- path: _(test|gen)\.go
linters:
- cyclop
- dupl
- funlen
- gocognit
- bodyclose
- maintidx
- unparam
- linters:
- paralleltest # false positive: https://github.com/kunwardeep/paralleltest/issues/8.
text: "does not use range value in test Run"
# As per https://github.com/golangci/golangci-lint/issues/207#issuecomment-534771981
- source: "^// http"
linters:
- lll
linters-settings:
cyclop:
max-complexity: 25
dupl:
threshold: 150
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 80
statements: 60
goconst:
min-len: 10
min-occurrences: 4
govet:
check-shadowing: true
gosec:
excludes:
- G107 # Http request made with variable url
- G204 # exec with variable command
- G404 # use of weak random number (not used for cryptographic purposes)
- G112 # Potential Slowloris Attack
- G304 # Potential file inclusion via variable
staticcheck:
checks: ["all", "-SA1019"]
linters:
enable-all: true
disable:
- noctx # too many false positives when making simple http requests in tests
- exhaustivestruct
- exhaustruct
- gci
- gochecknoinits
- gocyclo # replaced by cyclop since it also calculates the package complexity
- godot
- godox
- goerr113 # most of the errors here are meant for humans
- goheader
- golint # this linter is deprecated
- gomnd
- gomodguard
- interfacer # deprecated
- ireturn
- maligned # replaced by govet 'fieldalignment'
- nlreturn
- scopelint # deprecated, replaced by exportloopref
- tagliatelle
- testpackage
- thelper
- varnamelen # disabled before the final decision in (https://github.com/grafana/k6/pull/2323)
- wrapcheck # a little bit too much for k6, maybe after https://github.com/tomarrell/wrapcheck/issues/2 is fixed
- wsl
- containedctx
- usestdlibvars
- nosprintfhostport
- nonamedreturns
# Deprecated linters as of 1.53.3
- structcheck
- varcheck
- deadcode
- ifshort
- nosnakecase
- depguard # Dependency whitelist, needs to be configured
- inamedparam # Fails if interfaces do not have named params. Not in our code style.
- perfsprint # Suggests using strconv.* instead of fmt.* for printing numbers. Not very practical.
- protogetter # Complains when code reads var.Something if var.GetSomething() exists. Not useful.
fast: false