-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy path.golangci.yml
108 lines (105 loc) · 3 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
run:
timeout: 5m
linters:
enable:
- bodyclose
- containedctx
- exhaustive
- forbidigo
- gofmt
- govet
- ineffassign
- misspell
- nakedret
- noctx
- paralleltest
- perfsprint
- predeclared
- revive
- rowserrcheck
- sloglint
- sqlclosecheck
- staticcheck
- tenv
- unconvert
- unused
disable:
- errcheck
- gosec
- gosimple
linters-settings:
errcheck:
exclude-functions: [github.com/go-kit/kit/log:Log]
gofmt:
simplify: false
forbidigo:
forbid:
- p: ^exec\.Command.*$
msg: use ee/allowedcmd functions instead
- p: ^os\.Exit.*$
msg: do not use os.Exit so that launcher can shut down gracefully
- p: ^logutil\.Fatal.*$
msg: do not use logutil.Fatal so that launcher can shut down gracefully
- p: ^panic.*$
msg: do not use panic so that launcher can shut down gracefully
- p: ^go func.*$
msg: use gowrapper.Go() instead of raw goroutines for proper panic handling
- p: \.Cmd\.(Run|Start|Output|CombinedOutput)
msg: "Do not call embedded exec.Cmd methods directly on TracedCmd; call TracedCmd.Run(), TracedCmd.Start(), etc. instead"
- p: ^table\.NewPlugin.*$
msg: use ee/tables/tablewrapper to enforce timeouts on table queries
sloglint:
kv-only: true
context: "all"
key-naming-case: snake
static-msg: true
revive:
rules:
- name: superfluous-else
severity: warning
disabled: false
arguments:
- "preserveScope"
- name: package-comments
disabled: false
- name: context-as-argument
disabled: false
- name: context-keys-type
disabled: false
- name: error-return
disabled: false
- name: errorf
disabled: false
- name: unreachable-code
disabled: false
- name: early-return
disabled: false
- name: confusing-naming
disabled: false
- name: defer
disabled: false
staticcheck:
checks: ["all"]
issues:
exclude-rules:
# False positive: https://github.com/kunwardeep/paralleltest/issues/8.
- linters:
- paralleltest
text: "does not use range value in test Run"
# We prefer fmt.Sprintf over string concatenation for readability
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with string concatenation"
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with faster hex.EncodeToString"
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with faster strconv.FormatBool"
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with faster strconv.FormatInt"
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with faster strconv.FormatUint"
- linters: [perfsprint]
text: "fmt.Sprintf can be replaced with faster strconv.Itoa"
- linters: [perfsprint]
text: "fmt.Sprint can be replaced with faster strconv.Itoa"
exclude-dirs:
- test-cmds