-
Notifications
You must be signed in to change notification settings - Fork 590
/
.golangci.yml
104 lines (82 loc) · 2.69 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
run:
# timeout for analysis
timeout: 10m
linters-settings:
govet:
# Don't report about shadowed variables
check-shadowing: false
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
linters:
enable-all: true
disable:
# Global variables are used in many places throughout the code base.
- gochecknoglobals
# We want to allow short variable names.
- varnamelen
# We want to allow TODOs.
- godox
# Instances of table driven tests that don't pre-allocate shouldn't trigger
# the linter.
- prealloc
# Init functions are used by loggers throughout the codebase.
- gochecknoinits
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- tparallel
- unparam
- wastedassign
- execinquery
# Disable gofumpt as it has weird behavior regarding formatting multiple
# lines for a function which is in conflict with our contribution
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
- gofumpt
# Disable whitespace linter as it has conflict rules against our
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
- wsl
# Allow using default empty values.
- exhaustruct
# Allow exiting case select faster by putting everything in default.
- exhaustive
# Allow tests to be put in the same package.
- testpackage
# Don't run the cognitive related linters.
- gocognit
- gocyclo
- maintidx
- cyclop
# Allow customized interfaces to be returned from functions.
- ireturn
# Disable too many blank identifiers check. We won't be able to run this
# unless a large refactor has been applied to old code.
- dogsled
# We don't wrap errors.
- wrapcheck
# We use ErrXXX instead.
- errname
# Disable nil check to allow returning multiple nil values.
- nilnil
# We often split tests into separate test functions. If we are forced to
# call t.Helper() within those functions, we lose the information where
# exactly a test failed in the generated failure stack trace.
- thelper
# The linter is too aggressive and doesn't add much value since reviewers
# will also catch magic numbers that make sense to extract.
- gomnd
issues:
# Only check issues in the new code.
new-from-rev: 3f48b446215c751ea4ba0c30fb04413ab9f1a7c7
exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
# (math/rand) will pass the linter.
- path: _test\.go
linters:
- gosec
- errcheck
- dupl