|
1 | 1 | linters:
|
2 | 2 | disable-all: true
|
3 | 3 | enable:
|
4 |
| - - asasalint |
5 |
| - - asciicheck |
6 |
| - - bidichk |
7 |
| - - bodyclose |
8 |
| - - depguard |
9 |
| - - dogsled |
10 |
| - - dupl |
11 |
| - - errcheck |
12 |
| - - errchkjson |
13 |
| - - errorlint |
14 |
| - - exhaustive |
15 |
| - - exportloopref |
16 |
| - - goconst |
17 |
| - - gocritic |
18 |
| - - gocyclo |
19 |
| - - gofmt |
20 |
| - - goimports |
21 |
| - - goprintffuncname |
22 |
| - - gosec |
23 |
| - - gosimple |
24 |
| - - govet |
25 |
| - - importas |
26 |
| - - ineffassign |
27 |
| - - makezero |
28 |
| - - misspell |
29 |
| - - nakedret |
30 |
| - - nilerr |
31 |
| - - nolintlint |
32 |
| - - prealloc |
33 |
| - - revive |
34 |
| - - staticcheck |
35 |
| - - stylecheck |
36 |
| - - tagliatelle |
37 |
| - - typecheck |
38 |
| - - unconvert |
39 |
| - - unparam |
40 |
| - - unused |
41 |
| - - whitespace |
| 4 | + - asasalint |
| 5 | + - asciicheck |
| 6 | + - bidichk |
| 7 | + - bodyclose |
| 8 | + - depguard |
| 9 | + - dogsled |
| 10 | + - dupl |
| 11 | + - errcheck |
| 12 | + - errchkjson |
| 13 | + - errorlint |
| 14 | + - exhaustive |
| 15 | + - exportloopref |
| 16 | + - goconst |
| 17 | + - gocritic |
| 18 | + - gocyclo |
| 19 | + - gofmt |
| 20 | + - goimports |
| 21 | + - goprintffuncname |
| 22 | + - gosec |
| 23 | + - gosimple |
| 24 | + - govet |
| 25 | + - importas |
| 26 | + - ineffassign |
| 27 | + - makezero |
| 28 | + - misspell |
| 29 | + - nakedret |
| 30 | + - nilerr |
| 31 | + - nolintlint |
| 32 | + - prealloc |
| 33 | + - revive |
| 34 | + - staticcheck |
| 35 | + - stylecheck |
| 36 | + - tagliatelle |
| 37 | + - typecheck |
| 38 | + - unconvert |
| 39 | + - unparam |
| 40 | + - unused |
| 41 | + - whitespace |
42 | 42 |
|
43 | 43 | linters-settings:
|
44 | 44 | importas:
|
@@ -75,71 +75,74 @@ issues:
|
75 | 75 | exclude-use-default: false
|
76 | 76 | # List of regexps of issue texts to exclude, empty list by default.
|
77 | 77 | exclude:
|
78 |
| - # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time. |
79 |
| - # If it is decided they will not be addressed they should be moved above this comment. |
80 |
| - - Subprocess launch(ed with variable|ing should be audited) |
81 |
| - - (G204|G104|G307) |
82 |
| - - "ST1000: at least one file in a package should have a package comment" |
| 78 | + # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time. |
| 79 | + # If it is decided they will not be addressed they should be moved above this comment. |
| 80 | + - Subprocess launch(ed with variable|ing should be audited) |
| 81 | + - (G204|G104|G307) |
| 82 | + - "ST1000: at least one file in a package should have a package comment" |
83 | 83 | exclude-rules:
|
84 |
| - - linters: |
85 |
| - - gosec |
86 |
| - text: "G108: Profiling endpoint is automatically exposed on /debug/pprof" |
87 |
| - - linters: |
88 |
| - - revive |
89 |
| - text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported" |
90 |
| - - linters: |
91 |
| - - errcheck |
92 |
| - text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
93 |
| - # With Go 1.16, the new embed directive can be used with an un-named import, |
94 |
| - # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us. |
95 |
| - # This directive allows the embed package to be imported with an underscore everywhere. |
96 |
| - - linters: |
97 |
| - - revive |
98 |
| - source: _ "embed" |
99 |
| - # Exclude some packages or code to require comments, for example test code, or fake clients. |
100 |
| - - linters: |
101 |
| - - revive |
102 |
| - text: exported (method|function|type|const) (.+) should have comment or be unexported |
103 |
| - source: (func|type).*Fake.* |
104 |
| - - linters: |
105 |
| - - revive |
106 |
| - text: exported (method|function|type|const) (.+) should have comment or be unexported |
107 |
| - path: fake_\.go |
108 |
| - # Disable unparam "always receives" which might not be really |
109 |
| - # useful when building libraries. |
110 |
| - - linters: |
111 |
| - - unparam |
112 |
| - text: always receives |
113 |
| - # Dot imports for gomega and ginkgo are allowed |
114 |
| - # within test files. |
115 |
| - - path: _test\.go |
116 |
| - text: should not use dot imports |
117 |
| - - path: _test\.go |
118 |
| - text: cyclomatic complexity |
119 |
| - - path: _test\.go |
120 |
| - text: "G107: Potential HTTP request made with variable url" |
121 |
| - # Append should be able to assign to a different var/slice. |
122 |
| - - linters: |
123 |
| - - gocritic |
124 |
| - text: "appendAssign: append result not assigned to the same slice" |
125 |
| - - linters: |
126 |
| - - gocritic |
127 |
| - text: "singleCaseSwitch: should rewrite switch statement to if statement" |
128 |
| - # It considers all file access to a filename that comes from a variable problematic, |
129 |
| - # which is naiv at best. |
130 |
| - - linters: |
131 |
| - - gosec |
132 |
| - text: "G304: Potential file inclusion via variable" |
133 |
| - - linters: |
134 |
| - - revive |
135 |
| - text: "package-comments: should have a package comment" |
136 |
| - - linters: |
137 |
| - - dupl |
138 |
| - path: _test\.go |
| 84 | + - linters: |
| 85 | + - gosec |
| 86 | + text: "G108: Profiling endpoint is automatically exposed on /debug/pprof" |
| 87 | + - linters: |
| 88 | + - revive |
| 89 | + text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported" |
| 90 | + - linters: |
| 91 | + - errcheck |
| 92 | + text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
| 93 | + - linters: |
| 94 | + - staticcheck |
| 95 | + text: "SA1019: .* The component config package has been deprecated and will be removed in a future release." |
| 96 | + # With Go 1.16, the new embed directive can be used with an un-named import, |
| 97 | + # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us. |
| 98 | + # This directive allows the embed package to be imported with an underscore everywhere. |
| 99 | + - linters: |
| 100 | + - revive |
| 101 | + source: _ "embed" |
| 102 | + # Exclude some packages or code to require comments, for example test code, or fake clients. |
| 103 | + - linters: |
| 104 | + - revive |
| 105 | + text: exported (method|function|type|const) (.+) should have comment or be unexported |
| 106 | + source: (func|type).*Fake.* |
| 107 | + - linters: |
| 108 | + - revive |
| 109 | + text: exported (method|function|type|const) (.+) should have comment or be unexported |
| 110 | + path: fake_\.go |
| 111 | + # Disable unparam "always receives" which might not be really |
| 112 | + # useful when building libraries. |
| 113 | + - linters: |
| 114 | + - unparam |
| 115 | + text: always receives |
| 116 | + # Dot imports for gomega and ginkgo are allowed |
| 117 | + # within test files. |
| 118 | + - path: _test\.go |
| 119 | + text: should not use dot imports |
| 120 | + - path: _test\.go |
| 121 | + text: cyclomatic complexity |
| 122 | + - path: _test\.go |
| 123 | + text: "G107: Potential HTTP request made with variable url" |
| 124 | + # Append should be able to assign to a different var/slice. |
| 125 | + - linters: |
| 126 | + - gocritic |
| 127 | + text: "appendAssign: append result not assigned to the same slice" |
| 128 | + - linters: |
| 129 | + - gocritic |
| 130 | + text: "singleCaseSwitch: should rewrite switch statement to if statement" |
| 131 | + # It considers all file access to a filename that comes from a variable problematic, |
| 132 | + # which is naiv at best. |
| 133 | + - linters: |
| 134 | + - gosec |
| 135 | + text: "G304: Potential file inclusion via variable" |
| 136 | + - linters: |
| 137 | + - revive |
| 138 | + text: "package-comments: should have a package comment" |
| 139 | + - linters: |
| 140 | + - dupl |
| 141 | + path: _test\.go |
139 | 142 |
|
140 | 143 | run:
|
141 | 144 | timeout: 10m
|
142 | 145 | skip-files:
|
143 |
| - - "zz_generated.*\\.go$" |
144 |
| - - ".*conversion.*\\.go$" |
| 146 | + - "zz_generated.*\\.go$" |
| 147 | + - ".*conversion.*\\.go$" |
145 | 148 | allow-parallel-runners: true
|
0 commit comments