-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
120 lines (106 loc) · 3.46 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
---
linters-settings:
exhaustive:
default-signifies-exhaustive: true
cyclop:
max-complexity: 30
depguard:
rules:
main:
deny:
- pkg: "github.com/pkg/errors"
desc: "use 'errors' instead"
- pkg: "github.com/gogo/protobuf/proto"
desc: "use 'github.com/golang/protobuf/proto' instead"
- pkg: "github.com/percona/go-mysql/log/slow"
desc: "use only forked parser"
- pkg: "gopkg.in/yaml.v2"
desc: "use 'gopkg.in/yaml.v3' instead"
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/everest-operator) # Groups all local imports.
godot:
capital: true
goimports:
local-prefixes: github.com/percona/everest-operator
ireturn:
allow:
- anon
- error
- empty
- stdlib
- github.com/charmbracelet/bubbletea.Model
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
- goerr113 # 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
- exhaustruct # too many files to fix/nolint
- goerr113 # extra work & poor benefit
- varcheck # deprecated
- structcheck # deprecated
- golint
- nosnakecase
- deadcode
- exhaustive
- godox
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