-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.golangci.yml
80 lines (80 loc) · 2.78 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
linters-settings:
errcheck:
check-type-assertions: true
exhaustruct:
include:
- 'github\.com/bufbuild/vanguard\..*[cC]onfig'
forbidigo:
forbid:
- '^fmt\.Print'
- '^log\.'
- '^print$'
- '^println$'
- '^panic$'
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
- sb strings.Builder
- sb *strings.Builder
- ok bool
- op *operation
- op Operation
- t *ttStream
- rw *responseWriter
linters:
enable-all: true
disable:
- cyclop # covered by gocyclo
- depguard # unnecessary for small libraries
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # rely on gci instead
- inamedparam # convention is not followed
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- mnd # status codes are clearer than constants
- nlreturn # generous whitespace violates house style
- nonamedreturns # named returns are fine; it's *bare* returns that are bad
- protogetter # too many false positives
- tenv # replaced by usetesting
- testpackage # internal tests are fine
- 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, use wrapped static errors instead: .*"
exclude-rules:
- path: internal/examples/.*/.*\.go
linters:
- forbidigo # log.Fatal, fmt.Printf used in example programs
- gosec
- gochecknoglobals
- path: ".*_test.go"
linters:
- dupl # allow duplicate string literals for testing
- forcetypeassert
- nilerr # allow encoding error and returning nil
- path: vanguard_examples_test.go
linters:
- gocritic # allow log.Fatal for examples
- path: handler.go
linters:
- contextcheck # use request context
- path: params.go
linters:
- goconst # allow string literals for WKT names
- path: protocol.go
linters:
- gochecknoglobals # allow Protocol global helpers
text: "(allProtocols|protocolToString) is a global variable"