|
| 1 | +version: "2" |
1 | 2 | linters:
|
2 |
| - enable-all: true |
| 3 | + default: all |
3 | 4 | disable:
|
4 |
| - - contextcheck # too many false positives |
5 |
| - - depguard # checks if package imports are whitelisted |
6 |
| - - exhaustruct # too subjective and harms code readability |
| 5 | + - contextcheck |
| 6 | + - depguard |
| 7 | + - exhaustruct |
7 | 8 | - lll
|
8 |
| - - nlreturn # too strict and mostly code is not more readable |
9 |
| - - sqlclosecheck # not needed for this project |
10 |
| - - paralleltest # should be enabled consciously for long-running tests |
11 |
| - - tenv # deprecated (since v1.64.0) and replaced by usetesting |
12 |
| - - wsl # too strict and mostly code is not more readable |
13 |
| -linters-settings: |
14 |
| - gomoddirectives: |
15 |
| - replace-local: true |
16 |
| - replace-allow-list: |
17 |
| - - github.com/kyma-project/template-operator/api |
18 |
| - stylecheck: |
19 |
| - dot-import-whitelist: |
20 |
| - - github.com/onsi/ginkgo/v2 |
21 |
| - - github.com/onsi/gomega |
22 |
| - revive: |
23 |
| - severity: error |
| 9 | + - nlreturn |
| 10 | + - paralleltest |
| 11 | + - sqlclosecheck |
| 12 | + - wsl |
| 13 | + settings: |
| 14 | + cyclop: |
| 15 | + max-complexity: 20 |
| 16 | + exhaustruct: |
| 17 | + exclude: |
| 18 | + - gdfs |
| 19 | + funlen: |
| 20 | + lines: 80 |
| 21 | + gomoddirectives: |
| 22 | + replace-allow-list: |
| 23 | + - github.com/kyma-project/template-operator/api |
| 24 | + replace-local: true |
| 25 | + ireturn: |
| 26 | + allow: |
| 27 | + - anon |
| 28 | + - error |
| 29 | + - empty |
| 30 | + - stdlib |
| 31 | + - Client |
| 32 | + - record.EventRecorder |
| 33 | + - client.Object |
| 34 | + - schema.ObjectKind |
| 35 | + - runtime.Object |
| 36 | + - meta.RESTMapper |
| 37 | + - client.SubResourceWriter |
| 38 | + - openapi.Resources |
| 39 | + - validation.Schema |
| 40 | + - discovery.CachedDiscoveryInterface |
| 41 | + - machineryruntime.Object |
| 42 | + - v1.Layer |
| 43 | + - authn.Keychain |
| 44 | + - ratelimiter.RateLimiter |
| 45 | + nestif: |
| 46 | + min-complexity: 6 |
| 47 | + nolintlint: |
| 48 | + require-explanation: true |
| 49 | + revive: |
| 50 | + severity: error |
| 51 | + rules: |
| 52 | + - name: comment-spacings |
| 53 | + disabled: true |
| 54 | + - name: dot-imports |
| 55 | + severity: warning |
| 56 | + disabled: true |
| 57 | + - name: line-length-limit |
| 58 | + arguments: |
| 59 | + - 120 |
| 60 | + severity: warning |
| 61 | + disabled: true |
| 62 | + staticcheck: |
| 63 | + dot-import-whitelist: |
| 64 | + - github.com/onsi/ginkgo/v2 |
| 65 | + - github.com/onsi/gomega |
| 66 | + varnamelen: |
| 67 | + ignore-names: |
| 68 | + - ok |
| 69 | + ignore-type-assert-ok: true |
| 70 | + ignore-map-index-ok: true |
| 71 | + ignore-chan-recv-ok: true |
| 72 | + exclusions: |
| 73 | + generated: lax |
| 74 | + presets: |
| 75 | + - comments |
| 76 | + - common-false-positives |
| 77 | + - legacy |
| 78 | + - std-error-handling |
24 | 79 | rules:
|
25 |
| - - name: comment-spacings |
26 |
| - disabled: true |
27 |
| - - name: dot-imports |
28 |
| - severity: warning |
29 |
| - disabled: true |
30 |
| - - name: line-length-limit |
31 |
| - severity: warning |
32 |
| - disabled: true |
33 |
| - arguments: [ 120 ] |
34 |
| - funlen: |
35 |
| - lines: 80 |
36 |
| - cyclop: |
37 |
| - max-complexity: 20 |
38 |
| - nestif: |
39 |
| - min-complexity: 6 |
40 |
| - gci: |
41 |
| - sections: |
42 |
| - - standard # Standard packages. |
43 |
| - - default # Imports that could not be matched to another section type. |
44 |
| - - prefix(github.com/kyma-project/template-operator) # Imports with the specified prefix. |
45 |
| - - blank # Blank imports. |
46 |
| - - dot # Dot imports. |
47 |
| - custom-order: true |
48 |
| - skip-generated: true |
49 |
| - nolintlint: |
50 |
| - require-explanation: true |
51 |
| - ireturn: |
52 |
| - allow: |
53 |
| - - anon |
54 |
| - - error |
55 |
| - - empty |
56 |
| - - stdlib |
57 |
| - - Client |
58 |
| - - record.EventRecorder |
59 |
| - - client.Object |
60 |
| - - schema.ObjectKind #api/v1beta2/moduletemplate_types.go |
61 |
| - - runtime.Object #api/v1beta2/moduletemplate_types.go |
62 |
| - - meta.RESTMapper #internal/declarative/v2/client_proxy.go, internal/declarative/v2/rest_getter_proxy.go |
63 |
| - - client.SubResourceWriter #internal/declarative/v2/client_proxy.go |
64 |
| - - openapi.Resources #internal/declarative/v2/kube_factory_proxy.go |
65 |
| - - validation.Schema #internal/declarative/v2/kube_factory_proxy.go |
66 |
| - - discovery.CachedDiscoveryInterface #internal/declarative/v2/rest_getter_proxy.go |
67 |
| - - machineryruntime.Object #internal/declarative/v2/ssa.go |
68 |
| - - v1.Layer #internal/manifest/parse.go, tests/integration/controller/manifest/manifest.go |
69 |
| - - authn.Keychain #internal/manifest/spec_resolver.go, pkg/ocmextensions/cred.go |
70 |
| - - ratelimiter.RateLimiter #internal/rate_limiter.go |
71 |
| - varnamelen: |
72 |
| - ignore-names: |
73 |
| - - ok |
74 |
| - ignore-type-assert-ok: true |
75 |
| - ignore-map-index-ok: true |
76 |
| - ignore-chan-recv-ok: true |
77 |
| - exhaustruct: |
78 |
| - exclude: |
79 |
| - - gdfs |
| 80 | + - linters: |
| 81 | + - err113 |
| 82 | + - fatcontext |
| 83 | + - funlen |
| 84 | + - gochecknoglobals |
| 85 | + - maintidx |
| 86 | + - wrapcheck |
| 87 | + path: _test\.go |
| 88 | + - linters: |
| 89 | + - lll |
| 90 | + source: '^// +kubebuilder: ' |
| 91 | + - linters: |
| 92 | + - lll |
| 93 | + source: '^// http ' |
| 94 | + paths: |
| 95 | + - zz_generated.deepcopy.go |
| 96 | + - third_party$ |
| 97 | + - builtin$ |
| 98 | + - examples$ |
80 | 99 | issues:
|
81 |
| - exclude-files: |
82 |
| - - zz_generated.deepcopy.go |
83 |
| - exclude-rules: |
84 |
| - - path: "_test\\.go" |
85 |
| - linters: |
86 |
| - - wrapcheck # Errors do not need to be wrapped in unit and integration tests |
87 |
| - - err113 # Dynamic error creation in unit and integration tests is ok |
88 |
| - - gochecknoglobals # Does not apply to unit and integration tests |
89 |
| - - fatcontext # Tests will use fatcontext for convenience |
90 |
| - - funlen # Table driven unit and integration tests exceed function length by design |
91 |
| - - maintidx # Table driven unit and integration tests exceed maintainability index by design |
92 |
| - - linters: |
93 |
| - - lll |
94 |
| - source: "^// +kubebuilder: " # Exclude lll issues for long lines starting with kubebuilder marker prefix |
95 |
| - - linters: |
96 |
| - - lll # Exclude lll issues for long lines starting with an url |
97 |
| - source: "^// http " |
98 | 100 | max-issues-per-linter: 0
|
99 | 101 | max-same-issues: 0
|
100 |
| -output: |
101 |
| - sort-results: true |
102 |
| -run: |
103 |
| - timeout: 15m |
| 102 | +formatters: |
| 103 | + enable: |
| 104 | + - gci |
| 105 | + - gofmt |
| 106 | + - gofumpt |
| 107 | + - goimports |
| 108 | + settings: |
| 109 | + gci: |
| 110 | + sections: |
| 111 | + - standard |
| 112 | + - default |
| 113 | + - prefix(github.com/kyma-project/template-operator) |
| 114 | + - blank |
| 115 | + - dot |
| 116 | + custom-order: true |
| 117 | + exclusions: |
| 118 | + generated: lax |
| 119 | + paths: |
| 120 | + - zz_generated.deepcopy.go |
| 121 | + - third_party$ |
| 122 | + - builtin$ |
| 123 | + - examples$ |
0 commit comments