-
Notifications
You must be signed in to change notification settings - Fork 14
/
.golangci.yml
150 lines (140 loc) · 3.9 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 90s
linters:
enable-all: true
disable:
- cyclop
- depguard
- err113
- exhaustruct
- exhaustive
- forcetypeassert
- funlen
- godot
- gochecknoglobals
- gofumpt
- gomnd
- mnd
- nilnil
- nlreturn
- tagliatelle
- varnamelen
- whitespace
- wrapcheck
- wsl
linters-settings:
gosec:
excludes:
- G104
lll:
# Max line length, lines longer will be reported.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option.
# Default: 120.
line-length: 160
nestif:
min-complexity: 7
revive:
# Enable all available rules.
# Default: false
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: cognitive-complexity
disabled: true
- name: confusing-naming
disabled: true
- name: cyclomatic
disabled: true
- name: exported
disabled: true
- name: flag-parameter
disabled: true
- name: function-length
disabled: true
# same as lll
- name: line-length-limit
disabled: true
- name: max-public-structs
disabled: true
- name: nested-structs
disabled: true
# same as errcheck
- name: unhandled-error
disabled: true
- name: unused-receiver
disabled: true
- name: use-any
disabled: true
tenv:
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
# Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
# Default: false
all: true
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Some code is just exceptional. Review whenever the code is changed.
- path: influxdb3/query_iterator\.go
linters:
- gocyclo
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- goconst
- gofmt
- paralleltest
- tagalign
- testableexamples
- testpackage
- thelper
- tparallel
- unparam
- path: _test\.go
text: "Error return value of .((os.)?std(out|err)..*|.*Close.*|.*Flush|.*Disconnect|.*Clear|os.Remove(All)?|.*print(f|ln)?|os.(Un)?Setenv). is not checked"
- path: _test\.go
text: "G404: Use of weak random number generator" #gosec:G404
- path: _test\.go
text: "unused-parameter:" #revive:unused-parameter
- path: _test\.go
text: "require-error:" #testifylint:require-error
- path: _test\.go
text: "go-require:" #testifylint:go-require
# Relax some specific check for examples (for now, we should have really nice examples) - they are not executed in CI.
- path: .*example(_.*)?_test\.go$
text: "exitAfterDefer:" #gocritic:exitAfterDefer
- path: .*example(_.*)?_test\.go$
text: "deep-exit:" #revive:deep-exit
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option.
# To list all excluded by default patterns execute `golangci-lint run --help`.
# Default: true
exclude-use-default: false
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
output:
# The formats used to render issues.
# Default:
# formats:
# - format: colored-line-number
# path: stdout
formats:
- format: tab
path: stdout
# Make issues output unique by line.
# Default: true
uniq-by-line: false
# Sort results by the order defined in `sort-order`.
# Default: false
sort-results: true
# Show statistics per linter.
# Default: false
show-stats: true