|
1 | 1 | run: |
| 2 | + allow-parallel-runners: true |
2 | 3 | modules-download-mode: readonly |
3 | 4 | # Increase the default deadline from 1m as some module operations can take a |
4 | 5 | # while if uncached! |
5 | 6 | timeout: 10m |
| 7 | + go: "1.23" |
6 | 8 |
|
7 | 9 | linters: |
| 10 | + # sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml |
| 11 | + disable-all: true |
8 | 12 | enable: |
9 | | - - errcheck |
10 | | - - gosimple |
11 | | - - govet |
12 | | - - ineffassign |
13 | | - - staticcheck |
14 | | - - unused |
15 | | - - testifylint |
16 | | - - iface |
17 | | - - exptostd |
18 | | - - nilnesserr |
| 13 | + - asasalint |
| 14 | + - asciicheck |
| 15 | + - bidichk |
| 16 | + - bodyclose |
| 17 | + - copyloopvar |
| 18 | + - dogsled |
| 19 | + - dupl |
| 20 | + - errcheck |
| 21 | + - errchkjson |
| 22 | + - errorlint |
| 23 | + - exhaustive |
| 24 | + - ginkgolinter |
| 25 | + - goconst |
| 26 | + - gocritic |
| 27 | + - gocyclo |
| 28 | + - gofmt |
| 29 | + - goimports |
| 30 | + - goprintffuncname |
| 31 | + - gosimple |
| 32 | + - govet |
| 33 | + - importas |
| 34 | + - ineffassign |
| 35 | + - makezero |
| 36 | + - misspell |
| 37 | + - nakedret |
| 38 | + - nilerr |
| 39 | + - nolintlint |
| 40 | + - prealloc |
| 41 | + - revive |
| 42 | + - staticcheck |
| 43 | + - stylecheck |
| 44 | + - tagliatelle |
| 45 | + - typecheck |
| 46 | + - unconvert |
| 47 | + - unparam |
| 48 | + - unused |
| 49 | + - whitespace |
19 | 50 |
|
20 | 51 | issues: |
21 | 52 | exclude-rules: |
22 | 53 | # Dot imports for gomega and ginkgo are allowed |
23 | 54 | # within test files. |
24 | 55 | - path: _test\.go |
25 | 56 | text: should not use dot imports |
| 57 | + # Ignore error type switch case |
| 58 | + - path: "pkg/loader/loader.go" |
| 59 | + linters: |
| 60 | + - errorlint |
| 61 | + # Ignore test files |
| 62 | + - linters: |
| 63 | + - dupl |
| 64 | + - ginkgolinter |
| 65 | + path: _test\.go |
| 66 | + - linters: |
| 67 | + - gocritic |
| 68 | + path: "pkg/markers/help.go" |
| 69 | + - linters: |
| 70 | + - exhaustive |
| 71 | + path: "pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go" |
| 72 | + # Ignore consider pre-allocating variables |
| 73 | + - linters: |
| 74 | + - prealloc |
| 75 | + text: Consider pre-allocating |
| 76 | +linters-settings: |
| 77 | + govet: |
| 78 | + enable-all: true |
| 79 | + disable: |
| 80 | + - fieldalignment |
| 81 | + - shadow |
| 82 | + importas: |
| 83 | + no-unaliased: true |
| 84 | + revive: |
| 85 | + # By default, revive will enable only the linting rules that are named in the configuration file. |
| 86 | + # So, it's needed to explicitly enable all required rules here. |
| 87 | + rules: |
| 88 | + # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration |
| 89 | + - name: blank-imports |
| 90 | + - name: context-as-argument |
| 91 | + - name: context-keys-type |
| 92 | + - name: dot-imports |
| 93 | + - name: error-return |
| 94 | + - name: error-strings |
| 95 | + - name: error-naming |
| 96 | + - name: if-return |
| 97 | + - name: increment-decrement |
| 98 | + - name: var-naming |
| 99 | + - name: var-declaration |
| 100 | + - name: range |
| 101 | + - name: receiver-naming |
| 102 | + - name: time-naming |
| 103 | + - name: unexported-return |
| 104 | + - name: indent-error-flow |
| 105 | + - name: errorf |
| 106 | + - name: superfluous-else |
| 107 | + - name: unreachable-code |
| 108 | + - name: redefines-builtin-id |
| 109 | + # |
| 110 | + # Rules in addition to the recommended configuration above. |
| 111 | + # |
| 112 | + - name: bool-literal-in-expr |
| 113 | + - name: constant-logical-expr |
0 commit comments