-
Notifications
You must be signed in to change notification settings - Fork 155
/
.golangci.yml
88 lines (82 loc) · 2.33 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
83
84
85
86
87
88
linters:
disable-all: false # This enabled 7 default linters as of [email protected]:
# 1. errcheck
# 2. gosimple
# 3. govet
# 4. ineffassign
# 5. staticcheck
# 6. typecheck
# 7. unused
enable:
- gofmt
- whitespace
- gocognit
- unparam
- gocyclo
- gocritic
- lll
- nakedret
- asciicheck
# - depguard # Disabling temporarily due to https://github.com/golangci/golangci-lint/issues/3906
- dogsled
- dupl
- exportloopref
- importas
- misspell
- nestif
- gci
- goprintffuncname
- nolintlint
- stylecheck
run:
timeout: 10m # golangci-lint run's timeout.
build-tags: # All linters will run with below mentioned build tags.
- "integration"
issues:
exclude-use-default: false
exclude-rules:
- path: '_test.go'
linters:
- lll
- dupl
- nestif
- text: "`ctx` is unused" # Context might not be in use in places, but for consistency, we pass it.
linters:
- unparam
linters-settings:
gocyclo:
min-complexity: 20
lll:
line-length: 240
nakedret:
max-func-lines: 2
importas:
no-unaliased: true
alias:
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1
alias: crv1alpha1
nestif:
min-complexity: 6
gci:
sections:
- standard
- default
- prefix(github.com/kanisterio/kanister)
- blank
skip-generated: true
stylecheck:
checks: [ "all", "-ST1001", "-ST1005", "-ST1016", "-ST1023", "-ST1000"]
errcheck:
exclude-functions:
- fmt.Fprintln
exclude-dirs:
- pkg/client/applyconfiguration/cr/v1alpha1 # generated from code-gen
- pkg/client/clientset # generated from code-gen
- pkg/client/informers # generated from code-gen
- pkg/client/listers # generated from code-gen