forked from percona/pmm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
162 lines (145 loc) · 5.44 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
151
152
153
154
155
156
157
158
159
160
161
---
linters-settings:
exhaustive:
default-signifies-exhaustive: true
cyclop:
max-complexity: 30
depguard:
list-type: blacklist
include-go-root: true
packages:
# use "github.com/pkg/errors" instead
- errors
# use "github.com/golang/protobuf/proto" instead
- github.com/gogo/protobuf/proto
# use only forked parser
- github.com/percona/go-mysql/log/slow
# use "github.com/percona-platform/saas" instead
- github.com/percona-platform/platform
# use "gopkg.in/yaml.v3" instead
- gopkg.in/yaml.v2
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/percona/pmm) # Groups all local imports.
godot:
capital: true
goimports:
local-prefixes: github.com/percona/pmm
gomoddirectives:
replace-allow-list:
- github.com/percona-platform/dbaas-api
ireturn:
allow:
- anon
- error
- empty
- stdlib
- github.com/charmbracelet/bubbletea.Model
- github.com/percona/pmm/admin/commands.Result
lll:
line-length: 170
tab-width: 4
tagliatelle:
# Check the struck tag name case.
case:
rules:
avro: snake
bson: camel
# Disabled because we have too many errors at the moment
json: ""
# Disabled because we have too many errors at the moment
yaml: ""
xml: camel
unused:
check-exported: false #TODO: set true for agent
unparam:
check-exported: true
linters:
enable-all: true
disable:
# keep sorted
- exhaustivestruct # too annoying
- funlen # useless
- gochecknoglobals # mostly useless
- gochecknoinits # we use init functions
- gomnd # we are using numbers in many cases
- gomoddirectives # we use replace directives
- ifshort # a lot of false positives
- interfacer # deprecated
- maligned # deprecated
- nlreturn # too annoying
- scopelint # too many false positives
- varnamelen # useless
- wrapcheck # we do not use wrapping everywhere
- wsl # too annoying
- gocyclo # using cyclop with the max 30 instead
- exhaustruct # too many files to fix/nolint
- goerr113 # extra work & poor benefit
- paralleltest #temporary, needs to be processed
- tagliatelle #temporary, needs to be processed
- thelper #temporary, needs to be processed
- tparallel #temporary, needs to be processed
- gocritic #temporary, needs to be processed
- godot #temporary, needs to be processed
- godox #temporary, needs to be processed
- revive #temporary, needs to be processed
- nosnakecase #temporary, needs to be processed
- paralleltest #temporary, needs to be processed
- stylecheck #temporary, needs to be processed
- ireturn #temporary, needs to be processed
- gocognit #temporary, needs to be processed
- maintidx #temporary, needs to be processed
- nestif #temporary, needs to be processed
- whitespace #temporary, needs to be processed
- errorlint #temporary, needs to be processed
- forcetypeassert #temporary, needs to be processed
- golint #temporary, needs to be processed
- deadcode #temporary, needs to be processed
- gosec #temporary, needs to be processed
- nonamedreturns #temporary, needs to be processed
- noctx #temporary, needs to be processed
- usestdlibvars #temporary, needs to be processed
- execinquery #temporary, needs to be processed
- predeclared #temporary, needs to be processed
- nosprintfhostport #temporary, needs to be processed
- nilnil #temporary, needs to be processed
- nilerr #temporary, needs to be processed
- interfacebloat #temporary, needs to be processed
- gosimple #temporary, needs to be processed
- contextcheck #temporary, needs to be processed
- bodyclose #temporary, needs to be processed
- prealloc #temporary, needs to be processed
- nakedret #temporary, needs to be processed
- forbidigo #temporary, needs to be processed
- errcheck #temporary, needs to be processed
- dupl #temporary, needs to be processed
- depguard #temporary, needs to be processed
- containedctx #temporary, needs to be processed
run:
timeout: 5m
skip-dirs:
- agent/agents/mongodb/internal/
- qan-api2/migrations/
issues:
exclude-use-default: false
exclude:
# gas: Duplicated errcheck checks
- 'G104: Errors unhandled'
# golint: Methods for implementing interfaces are not documented
- 'exported method `.+` should have comment or be unexported'
- 'comment on exported method `.+` should be of the form `.+ ...`'
# golint: We have to return unexported types due to oneof implementation
- 'exported method .+ returns unexported type .+, which can be annoying to use'
exclude-rules:
- path: _test\.go
linters:
# keep sorted
- exhaustivestruct # very annoying
- funlen # tests may be long
- gocognit # triggered by subtests
- gomnd # tests are full of magic numbers
- testpackage # senseless
- unused # very annoying false positive: https://github.com/golangci/golangci-lint/issues/791
- lll # tests often require long lines