-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy path.golangci.yml
More file actions
122 lines (111 loc) · 2.71 KB
/
.golangci.yml
File metadata and controls
122 lines (111 loc) · 2.71 KB
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
version: "2"
run:
go: "1.24"
linters:
default: all
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
# We have long functions, especially in tests. Moving or renaming those would
# trigger funlen problems that we may not want to solve at that time.
- funlen
# Disable for now as we haven't yet tuned the sensitivity to our codebase
# yet. Enabling by default for example, would also force new contributors to
# potentially extensively refactor code, when they want to smaller change to
# land.
- gocyclo
- gocognit
- cyclop
# 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
# Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19.
- errorlint
# Don't forbid an empty line after function signature. We add it in multi-line case.
- wsl_v5
# Don't forbid "if err := ...; err != nil" checks.
- noinlineerr
# Don't demand any particular functions order.
- funcorder
# New linters that need a code adjustment first.
- containedctx
- contextcheck
- depguard
- dogsled
- err113
- errname
- exhaustive
- exhaustruct
- forcetypeassert
- gomoddirectives
- importas
- inamedparam
- interfacebloat
- ireturn
- maintidx
- mnd
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- paralleltest
- perfsprint
- protogetter
- testpackage
- thelper
- tparallel
- wrapcheck
- wsl
settings:
gosec:
excludes:
- G402 # Look for bad TLS connection settings.
- G306 # Poor file permissions used when writing to a new file.
- G115 # Integer overflow conversion.
lll:
line-length: 80
revive:
rules:
- name: exported # To enforce conventions around exported comments.
staticcheck:
checks:
- -SA1019
tagliatelle:
case:
rules:
json: snake
whitespace:
multi-if: true
multi-func: true
exclusions:
generated: lax
presets:
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$