|
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + build-tags: |
| 4 | + - e2e |
| 5 | + - hpa |
| 6 | + - upgrade |
| 7 | + allow-parallel-runners: true |
| 8 | +output: |
| 9 | + sort-order: |
| 10 | + - linter |
| 11 | + - file |
| 12 | +linters: |
| 13 | + enable: |
| 14 | + # Check for pass []any as any in variadic func(...any). |
| 15 | + - asasalint |
| 16 | + |
| 17 | + # Only use ASCII chars in indentifiers |
| 18 | + - asciicheck |
| 19 | + |
| 20 | + # Dangerous unicode characters |
| 21 | + - bidichk |
| 22 | + |
| 23 | + # Checks whether HTTP response body is closed successfully. |
| 24 | + - bodyclose |
| 25 | + |
| 26 | + # Canonicalheader checks whether net/http.Header uses canonical header. |
| 27 | + - canonicalheader |
| 28 | + |
| 29 | + # TODO - do a follow up PR |
| 30 | + # # Containedctx is a linter that detects struct contained context.Context |
| 31 | + # # field. |
| 32 | + # - containedctx |
| 33 | + # |
| 34 | + # TODO - do a follow up PR |
| 35 | + # # Check whether the function uses a non-inherited context. |
| 36 | + # - contextcheck |
| 37 | + |
| 38 | + # Copyloopvar is a linter detects places where loop variables are copied. |
| 39 | + - copyloopvar |
| 40 | + |
| 41 | + # Check declaration order of types, consts, vars and funcs. |
| 42 | + - decorder |
| 43 | + |
| 44 | + # Check for two durations multiplied together. |
| 45 | + - durationcheck |
| 46 | + |
| 47 | + # Checks that sentinel errors are prefixed with the Err- and error types |
| 48 | + # are suffixed with the -Error. |
| 49 | + - errname |
| 50 | + |
| 51 | + # Errorlint is a linter for that can be used to find code that will cause |
| 52 | + # problems with the error wrapping scheme introduced in Go 1.13. |
| 53 | + - errorlint |
| 54 | + |
| 55 | + # Detects nested contexts in loops. |
| 56 | + - fatcontext |
| 57 | + |
| 58 | + # Checks that go compiler directive comments (//go:) are valid. |
| 59 | + - gocheckcompilerdirectives |
| 60 | + |
| 61 | + # Provides diagnostics that check for bugs, performance and style issues. |
| 62 | + # Extensible without recompilation through dynamic rules. |
| 63 | + # Dynamic rules are written declaratively with AST patterns, filters, |
| 64 | + # report message and optional suggestion. |
| 65 | + - gocritic |
| 66 | + |
| 67 | + # See config below |
| 68 | + - gomodguard |
| 69 | + |
| 70 | + # Inspects source code for security problems. |
| 71 | + - gosec |
| 72 | + |
| 73 | + # Intrange is a linter to find places where for loops could make use of |
| 74 | + # an integer range. |
| 75 | + - intrange |
| 76 | + |
| 77 | + # Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). |
| 78 | + - loggercheck |
| 79 | + |
| 80 | + # Finds slice declarations with non-zero initial length. |
| 81 | + - makezero |
| 82 | + |
| 83 | + # Reports wrong mirror patterns of bytes/strings usage |
| 84 | + - mirror |
| 85 | + |
| 86 | + # Finds commonly misspelled English words. |
| 87 | + - misspell |
| 88 | + |
| 89 | + # Finds the code that returns nil even if it checks that the error is not nil. |
| 90 | + - nilerr |
| 91 | + |
| 92 | + # Finds sending HTTP request without context.Context. |
| 93 | + - noctx |
| 94 | + |
| 95 | + # Reports ill-formed or insufficient nolint directives. |
| 96 | + - nolintlint |
| 97 | + |
| 98 | + # Checks for misuse of Sprintf to construct a host with port in a URL. |
| 99 | + - nosprintfhostport |
| 100 | + |
| 101 | + # Checks that fmt.Sprintf can be replaced with a faster alternative. |
| 102 | + - perfsprint |
| 103 | + |
| 104 | + # Finds slice declarations that could potentially be pre-allocated. |
| 105 | + - prealloc |
| 106 | + |
| 107 | + # Reports direct reads from proto message fields when getters should be used. |
| 108 | + - protogetter |
| 109 | + |
| 110 | + # Checks that package variables are not reassigned. |
| 111 | + - reassign |
| 112 | + |
| 113 | + # Fast, configurable, extensible, flexible, and beautiful linter for |
| 114 | + # Go. Drop-in replacement of golint. |
| 115 | + - revive |
| 116 | + |
| 117 | + # Checks for mistakes with OpenTelemetry/Census spans. |
| 118 | + - spancheck |
| 119 | + |
| 120 | + - staticcheck |
| 121 | + |
| 122 | + # Linter checks if examples are testable (have an expected output). |
| 123 | + - testableexamples |
| 124 | + |
| 125 | + # Remove unnecessary type conversions. |
| 126 | + - unconvert |
| 127 | + |
| 128 | + # Reports unused function parameters and results in your code. |
| 129 | + - unparam |
| 130 | + |
| 131 | + # A linter that detect the possibility to use variables/constants from the |
| 132 | + # Go standard library. |
| 133 | + - usestdlibvars |
| 134 | + |
| 135 | + # Finds wasted assignment statements. |
| 136 | + - wastedassign |
| 137 | + |
| 138 | + # Whitespace is a linter that checks for unnecessary newlines at the start |
| 139 | + # and end of functions, if, for, etc. |
| 140 | + - whitespace |
| 141 | + disable: |
| 142 | + - errcheck |
| 143 | + settings: |
| 144 | + staticcheck: |
| 145 | + checks: |
| 146 | + - all |
| 147 | + - "-QF1008" # Disable https://staticcheck.dev/docs/checks/#QF1008 |
| 148 | + gocritic: |
| 149 | + disabled-checks: |
| 150 | + - exitAfterDefer |
| 151 | + - appendAssign |
| 152 | + gomodguard: |
| 153 | + blocked: |
| 154 | + modules: |
| 155 | + - github.com/ghodss/yaml: |
| 156 | + recommendations: |
| 157 | + - sigs.k8s.io/yaml |
| 158 | + - go.uber.org/atomic: |
| 159 | + recommendations: |
| 160 | + - sync/atomic |
| 161 | + - io/ioutil: |
| 162 | + recommendations: |
| 163 | + - os |
| 164 | + - io |
| 165 | + - github.com/hashicorp/go-multierror: |
| 166 | + recommendations: |
| 167 | + - errors |
| 168 | + reason: use errors.Join |
| 169 | + - go.uber.org/multierr: |
| 170 | + recommendations: |
| 171 | + - errors |
| 172 | + reason: use errors.Join |
| 173 | + revive: |
| 174 | + rules: |
| 175 | + - name: unused-parameter |
| 176 | + disabled: true |
| 177 | + exclusions: |
| 178 | + generated: lax |
| 179 | + presets: |
| 180 | + - comments |
| 181 | + - common-false-positives |
| 182 | + - legacy |
| 183 | + - std-error-handling |
| 184 | + rules: |
| 185 | + - linters: |
| 186 | + - staticcheck |
| 187 | + text: corev1.Endpoint.* is deprecated |
| 188 | + - linters: |
| 189 | + - gosec |
| 190 | + - noctx |
| 191 | + - protogetter |
| 192 | + - unparam |
| 193 | + path: test |
| 194 | + - linters: |
| 195 | + - gocritic |
| 196 | + text: ifElseChain |
| 197 | + paths: |
| 198 | + - pkg/client |
| 199 | + - third_party$ |
| 200 | + - builtin$ |
| 201 | + - examples$ |
| 202 | +issues: |
| 203 | + max-issues-per-linter: 0 |
| 204 | + max-same-issues: 0 |
| 205 | + uniq-by-line: true |
| 206 | +formatters: |
| 207 | + enable: |
| 208 | + - gofmt |
| 209 | + - gofumpt |
| 210 | + - goimports |
| 211 | + exclusions: |
| 212 | + generated: lax |
| 213 | + paths: |
| 214 | + - pkg/client |
| 215 | + - third_party$ |
| 216 | + - builtin$ |
| 217 | + - examples$ |
0 commit comments