-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path.golangci.yml
More file actions
69 lines (66 loc) · 2.22 KB
/
.golangci.yml
File metadata and controls
69 lines (66 loc) · 2.22 KB
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
run:
timeout: 5m
skip-dirs:
- pkg/generated
- go
skip-files: [zz_generated.deepcopy.go]
linters:
# Enable all linters
presets:
- bugs
- complexity
- format
- performance
- style
- unused
# Selectively disable things to get a pass. These probably are
# masking bugs so re-enable and fix them!
# These disables were copied over directly from Operator. We should remove them and
# see fix any issues discovered.
disable:
- gosec # insecure!
- nestif # complicated code
- gomnd # magic numbers
- testpackage # packages for test, need to be marked as test
- gocognit # complicated functions
- gocyclo # complicated functions
- godox # TODOs are bad, it suggests it's not finished
- maligned # memory alignment - this is fine
- funlen # complicated functions
- gochecknoglobals # global variables
- lll # long lines
- gochecknoinits # init functions
- goconst # repeated things that should be constants
- prealloc # constant sized arrays can be preallocated
- nakedret # using naked returns in complicated functions
- exhaustive # doesn't pay attention to default in switch statements
- exhaustivestruct # it's okay not to define every field
- gofumpt # really anal
- paralleltest # really really anal
- nlreturn # seems at odds with cuddling
- noctx # do want to fix this
- wrapcheck # we do want this, but I want https://github.com/tomarrell/wrapcheck/issues/2 fixing first
- tagliatelle # This chokes on Couchbase Server Models that cannot be changed
linters-settings:
# Code duplication filter catches a lot of duplication in test
# this needs refactoring at some point.
dupl:
threshold: 500
cyclop:
max-complexity: 25
issues:
exclude-rules:
# Deep copies have 'in' as the receiver, ours have something else.
# This linter should ignore the auto generated stuff, but doesn't.
- text: ST1016
linters:
- stylecheck
# Things that are parameterized, and don't need to be. This is probably
# a gap in testing.
- text: always receives
linters:
- unparam
# Test is exempt from proper error handling.
- path: test/.*
linters:
- goerr113