-
Notifications
You must be signed in to change notification settings - Fork 19
/
.golangci.yml
81 lines (81 loc) · 2.91 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
linters-settings:
errcheck:
check-type-assertions: true
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
- ok bool
- w io.Writer
linters:
enable-all: true
disable:
- copyloopvar # enable once go 1.22 is baseline
- cyclop # covered by gocyclo
- depguard # we can manage dependencies strictly if the need arises in the future
- err113 # internal error causes may be dynamic
- execinquery # deprecated by author
- exhaustruct # don't _always_ need to exhaustively create struct
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # rely on gci instead
- gomnd # some unnamed constants are okay
- gomoddirectives # we use go modules replacements intentionally
- gomodguard # not compatible with go workspaces
- intrange # enable once go 1.22 is baseline
- 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
- nonamedreturns # usage of named returns should be selective
- testpackage # internal tests are fine
- wrapcheck # don't _always_ need to wrap errors
- wsl # over-generous whitespace violates house style
issues:
exclude-use-default: true
exclude:
# we will continue to support the deprecated field until it's removed
- "IgnoreEmpty is deprecated"
- "Skipped is deprecated"
exclude-rules:
# Loosen requirements on conformance executor
- path: internal/cmd/
linters:
- forbidigo
- errorlint
# Loosen requirements on tests
- path: _test.go
linters:
- funlen
- varnamelen
- unparam
- gosec
- path: celext/lib.go
linters:
# setting up custom functions/overloads appears duplicative (false positive)
- dupl
# Types are checked internally within CEL. There are bigger issues if its
# type analysis is wrong
- forcetypeassert
# static unexported lookup tables
- path: internal/constraints/lookups.go
linters:
- gochecknoglobals
- path: resolver/resolver.go
linters:
# uses deprecated fields on protoimpl.ExtensionInfo but its the only way
- staticcheck