-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
128 lines (126 loc) · 3.42 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# https://golangci-lint.run/usage/configuration/#config-file
# ~/go/bin/golangci-lint run ./pkg/...
# gofmt -s -w ./pkg
linters:
disable-all: true
enable:
# - goerr113 WIP
- errcheck
- goimports
- revive
- staticcheck
- govet
- forbidigo
linters-settings:
errcheck:
severity: error
confidence: 0.8
rules:
- name: unhandled-error
arguments:
- "*"
revive:
severity: error
confidence: 0.8
enable-all-rules: true
rules:
# Disabled rules
- name: confusing-results
disabled: true
- name: add-constant
disabled: true
- name: argument-limit
disabled: true
- name: empty-lines
disabled: true
- name: exported
disabled: true
- name: function-length
disabled: true
- name: line-length-limit
disabled: true
- name: max-public-structs
disabled: true
- name: unused-receiver
disabled: true
- name: var-naming
disabled: true
- name: flag-parameter
disabled: true
# Rule tuning
- name: max-control-nesting
arguments:
- 8
- name: cognitive-complexity
arguments:
- 50
- name: cyclomatic
arguments:
- 30
- name: function-result-limit
arguments:
- 4
- name: unhandled-error
arguments:
- "fmt.*"
- "bytes.Buffer.*"
- "strings.Builder.*"
- "os.File.Close"
- "io.Closer.Close"
- "zap.Logger.Sync"
- "net.Conn.Close"
issues:
exclude-dirs:
- ^ui
- ^build
- ^doc
- ^.git
exclude-rules:
- path: pkg\/eval\/agg\.go
text: "function [^ ]+callAgg(Min|Max)Internal has cognitive complexity" # 58 > 50
linters:
- revive
- path: pkg\/proc\/proc_file_creator\.go
text: "unchecked-type-assertion: type cast result is unchecked in [^ ]+FileRecordHeapItem"
linters:
- revive
- path: ^tests\/.+\.go
text: cyclomatic|cognitive
linters:
- revive
- path: .+\.go
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Sync|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
linters:
- errcheck
- path: pkg\/xfer\/ssh\.go
text: "SA1019: x509.IsEncryptedPEMBlock|SA1019: x509.DecryptPEMBlock"
linters:
- staticcheck
- path: pkg\/storage\/parquet\.go
text: "SA5001: should check returned error before deferring f.Close()"
linters:
- staticcheck
- path: pkg\/proc\/file_read_csv\.go
text: function readCsv has cognitive complexity
linters:
- revive
- path: pkg\/proc\/proc_table_creator\.go
text: function RunCreateTableRelForBatch has (cyclomatic|cognitive) complexity
linters:
- revive
- path: pkg\/proc\/proc_table_creator\.go
text: function RunReadFileForBatch has cognitive complexity
linters:
- revive
- path: pkg\/eval\/eval_ctx\.go
text: EvalFunc has cyclomatic complexity
linters:
- revive
- path: pkg\/wf\/amqp_client\.go
text: function amqpConnectAndSelect has cognitive complexity
linters:
- revive
- path: pkg\/exe\/toolbelt\/.+\.go
text: use of `fmt.Print(|f|ln)` forbidden by pattern
linters:
- forbidigo