-
Notifications
You must be signed in to change notification settings - Fork 13
/
.golangci.yml
82 lines (82 loc) · 2.95 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
linters-settings:
errcheck:
check-type-assertions: true
forbidigo:
forbid:
- '^fmt\.Print'
- '^print$'
- '^println$'
- '^panic$'
gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/bufbuild/plugins) # 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]
govet:
disable:
- loopclosure # not needed in go 1.22
tagliatelle:
# Check the struck tag name case.
case:
rules:
json: snake
yaml: snake
varnamelen:
ignore-decls:
- T any
- i int
- wg sync.WaitGroup
linters:
enable-all: true
disable:
- exhaustruct
- varnamelen
# Other disabled linters
- cyclop # covered by gocyclo
- depguard # not needed
- execinquery # deprecated by author
- exportloopref # deprecated by author
- funlen # rely on code review to limit function length
- gochecknoglobals # sometimes useful to declare constants
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # using gci
- gomnd # replaced by mnd
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- mnd # some unnamed constants are okay
- nlreturn # generous whitespace violates house style
- perfsprint # waiting for https://github.com/catenacyber/perfsprint/issues/21
- rowserrcheck # no SQL code in plugins
- sqlclosecheck # no SQL code in plugins
- testpackage # internal tests are fine
- wastedassign # not supported with generics
- wrapcheck # don't _always_ need to wrap errors
- wsl # generous whitespace violates house style
issues:
exclude-dirs-use-default: false
exclude-rules:
- linters:
- err113
- goerr113
text: "do not define dynamic errors"
# Benchmarks can't be run in parallel
- path: benchmark_test\.go
linters:
- paralleltest
# dupword reports several errors in .proto test fixtures
# gosec reports a few minor issues in tests
- path: _test\.go
linters:
- dupword
- gosec