-
Notifications
You must be signed in to change notification settings - Fork 19
/
.golangci.yml
64 lines (64 loc) · 2.68 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
linters-settings:
errcheck:
check-type-assertions: true
exhaustruct:
include:
# No zero values for param structs.
- 'connect-examples-go\..*[pP]arams'
forbidigo:
forbid:
# Unlike most Buf projects, we're allowing the standard library's log
# package: this is a demo service, so let's keep it simple.
- '^fmt\.Print'
- '^print$'
- '^println$'
- '^panic$'
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(connect-examples-go) # Custom section: groups all imports with the specified Prefix.
godox:
# TODO, OPT, etc. comments are fine to commit. Use FIXME comments for
# temporary hacks, and use godox to prevent committing them.
keywords: [FIXME]
varnamelen:
ignore-decls:
- T any
- i int
- wg sync.WaitGroup
linters:
enable-all: true
disable:
- copyloopvar # only valid for go v1.22 and above
- cyclop # covered by gocyclo
- depguard # in golangci-lint v1.53.0+ default requires only stdlib deps
- exportloopref # deprecated in golangci v1.60.2
- execinquery # deprecated in golangci v1.58
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # rely on gci instead
- gomnd # deprecated in golangci v1.58 in favor of mnd
- mnd # some unnamed constants are okay
- intrange # only valid for go v1.22 and above
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- nlreturn # generous whitespace violates house style
- paralleltest # in this project, it's not worth making all tests parallel
- testpackage # internal tests are fine
- tparallel # in this project, it's not worth making all tests parallel
- wrapcheck # don't _always_ need to wrap errors
- wsl # generous whitespace violates house style
issues:
exclude-dirs-use-default: false
exclude:
# Don't ban use of fmt.Errorf to create new errors, but the remaining
# checks from err113 are useful.
- "do not define dynamic errors.*"
exclude-rules:
# It's much more convenient to keep eliza's matching and response data as
# globals rather than config.
- linters: [gochecknoglobals]
path: internal/eliza/globals.go