-
Notifications
You must be signed in to change notification settings - Fork 0
/
golangci.yml
115 lines (110 loc) · 2.72 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
run:
timeout: 20m
go: 1.22
linters-settings:
gocyclo:
# minimal code complexity to report
min-complexity: 10
maligned:
# print struct with more effective memory layout
suggest-new: true
lll:
line-length: 512
revive:
enable-all-rules: true
ignore-generated-header: true
rules:
- name: function-result-limit
arguments:
- 3
- name: argument-limit
arguments:
# has to be reduced in a separate PR
- 6
- name: cyclomatic
# handled by gocyclo
disabled: true
- name: unhandled-error
arguments:
- fmt.Fprintf
- fmt.Fprintln
- name: cognitive-complexity
arguments:
- 10
- name: function-length
disabled: true
- name: max-public-structs
disabled: true
- name: line-length-limit
disabled: true
- name: add-constant
disabled: true
- name: file-header
disabled: true
- name: banned-characters
disabled: true
linters:
enable-all: true
disable:
# gofumpt also includes gofumports. These are a stricter version of gofmt
# and goimports respectively. By enabling them we also wanted to include
# them in our vim configurations to be run on save. Unfortunately this
# makes vim.coc report errors very slowly, or not at all. If we decide to
# enable them back we should also make sure that they work in our vim configs.
- gofumpt
# whitespaces are not that important
- wsl
- paralleltest
issues:
exclude-use-default: false
exclude-rules:
- linters:
- errcheck
text: 'return value of `resp.Body.Close`'
- linters:
- golint
text: "Protocol should have comment"
- linters:
- stylecheck
text: "ST1000"
- linters:
- goerr113
text: "do not define dynamic errors"
- path: internal
linters:
- golint
text: "should have comment or be unexported"
- path: _test\.go
linters:
- goconst
- dupl
- gomnd
- gochecknoglobals
- exhaustivestruct
- linters:
- goerr113
text: "do not define dynamic errors"
# scopelint has false positives for table tests https://github.com/kyoh86/scopelint/issues/4
- path: _test.go
linters:
- scopelint
text: "tc"
- path: _test.go
linters:
- scopelint
text: "testcase"
- linters:
- exhaustivestruct
text: 'k8s'
- linters:
- exhaustivestruct
text: 'metav1'
- linters:
- exhaustivestruct
text: 'Pod'
# Maximum issues count per one linter. Set to 0 to disable.
max-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable
max-same: 0
# Show only new issues
new: false