forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
62 lines (51 loc) · 2.02 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
linters:
disable-all: true
enable:
- gofmt
- govet
- unconvert
- staticcheck
- ineffassign
- unparam
issues:
# Disable the default exclude list so that all excludes are explicitly
# defined in this file.
exclude-use-default: false
exclude-rules:
# Temp Ignore SA9004: only the first constant in this group has an explicit type
# https://staticcheck.io/docs/checks#SA9004
- linters: [staticcheck]
text: 'SA9004:'
- linters: [staticcheck]
text: 'SA1019: Package github.com/golang/protobuf/jsonpb is deprecated'
- linters: [staticcheck]
text: 'SA1019: Package github.com/golang/protobuf/proto is deprecated'
# An argument that always receives the same value is often not a problem.
- linters: [unparam]
text: 'always receives'
# Often functions will implement an interface that returns an error without
# needing to return an error. Sometimes the error return value is unnecessary
# but a linter can not tell the difference.
- linters: [unparam]
text: 'result \d+ \(error\) is always nil'
# Allow unused parameters to start with an underscore. Arguments with a name
# of '_' are already ignored.
# Ignoring longer names that start with underscore allow for better
# self-documentation than a single underscore by itself. Underscore arguments
# should generally only be used when a function is implementing an interface.
- linters: [unparam]
text: '`_[^`]*` is unused'
# Temp ignore some common unused parameters so that unparam can be added
# incrementally.
- linters: [unparam]
text: '`(t|resp|req|entMeta)` is unused'
# Temp ignore everything in _oss(_test).go and _ent(_test).go. Many of these
# could use underscore to ignore the unused arguments, but the "always returns"
# issue will likely remain in oss, and will need to be excluded.
- linters: [unparam]
path: '(_oss.go|_oss_test.go|_ent.go|_ent_test.go)'
linters-settings:
gofmt:
simplify: true
run:
timeout: 10m