forked from pingcap/tiflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
130 lines (122 loc) · 2.25 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
129
130
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exportloopref
- gocritic
- godot
- goprintffuncname
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
- prealloc
- revive
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- durationcheck
- gofumpt
- goheader
- gomodguard
- ifshort
- importas
- makezero
- nilerr
- predeclared
- sqlclosecheck
- thelper
- tparallel
- wastedassign
# don't enable:
# - testpackage
# - lll
# - wsl
# - gochecknoglobals
# - godox
# - gomnd
# - goerr113
# - exhaustive
# - wrapcheck
# - nlreturn
# - exhaustivestruct
# - errorlint
# - forcetypeassert
# - paralleltest
# - forbidigo
# - gosec
# - goconst
# - interfacer
# - scopelint
# already cover:
# - gci
# - goimports
# - gofmt
# better to fix them
# - funlen
# - gocognit
# - nestif
# - gocyclo
# - cyclop
# - gomoddirectives
# - gochecknoinits
# - maligned
linters-settings:
dupl:
# tokens count to trigger issue, 150 by default
threshold: 200
govet:
# report about shadowed variables
check-shadowing: true
revive:
ignoreGeneratedHeader: false
severity: "error"
confidence: 0.8
errorCode: -1
warningCode: -1
rules:
- name: blank-imports
- name: context-as-argument
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: var-naming
- name: package-comments
- name: range
- name: receiver-naming
- name: indent-error-flow
- name: superfluous-else
- name: modifies-parameter
- name: unreachable-code
issues:
include:
- EXC0003
exclude-rules:
# TODO Remove it.
# Exclude some staticcheck messages
- linters:
- staticcheck
text: "SA1019:"
# Fix found issues (if it's supported by the linter)
fix: false
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m