kuma

Форк
0
/
.golangci.yml 
143 строки · 5.0 Кб
1
linters:
2
  enable:
3
    - bodyclose
4
    - contextcheck
5
    - errcheck
6
    - gci
7
    - ginkgolinter
8
    - gocritic
9
    - gofumpt
10
    - gomodguard
11
    - gosimple
12
    - govet
13
    - gosec
14
    - importas
15
    - ineffassign
16
    - misspell
17
    - nonamedreturns
18
    - staticcheck
19
    - typecheck
20
    - unconvert
21
    - unparam
22
    - unused
23
    - whitespace
24
    - nosprintfhostport
25
    - loggercheck
26

27
run:
28
  skip-files:
29
    - app/kumactl/pkg/k8s/kubectl_proxy.go # excluded to keep as close to original file from K8S repository
30
    - pkg/xds/server/server.go # excluded to keep as close to original file from Envoy repository
31
    - pkg/xds/server/server_test.go # excluded to keep as close to original file from Envoy repository
32
  modules-download-mode: readonly
33
  skip-dirs-use-default: false # The default skip omits "builtin" directories, which we have.
34
  skip-dirs:
35
    - (^|/)vendored($|/)
36
  timeout: 30m
37

38
linters-settings:
39
  gocritic:
40
    disabled-checks:
41
      - singleCaseSwitch
42
  gci:
43
    sections:
44
    - standard
45
    - default
46
    - prefix(github.com/kumahq/kuma)
47
    custom-order: true
48
  importas:
49
    alias:
50
    - pkg: github.com/kumahq/kuma/pkg/core/resources/apis/mesh
51
      alias: core_mesh
52
    - pkg: github.com/kumahq/kuma/api/mesh/v1alpha1
53
      alias: mesh_proto
54
    - pkg: github.com/kumahq/kuma/api/system/v1alpha1
55
      alias: system_proto
56
    - pkg: github.com/kumahq/kuma/pkg/util/proto
57
      alias: util_proto
58
    - pkg: github.com/kumahq/kuma/pkg/util/rsa
59
      alias: util_rsa
60
    - pkg: github.com/kumahq/kuma/pkg/cmd
61
      alias: kuma_cmd
62
    - pkg: github.com/kumahq/kuma/pkg/plugins/bootstrap/k8s
63
      alias: bootstrap_k8s
64
    - pkg: github.com/kumahq/kuma/pkg/config/core
65
      alias: config_core
66
    - pkg: github.com/kumahq/kuma/pkg/core/resources/model
67
      alias: core_model
68
    - pkg: github.com/kumahq/kuma/api/common/v1alpha1
69
      alias: common_api
70
    - pkg: github.com/kumahq/kuma/api/openapi/types
71
      alias: api_types
72
  gomodguard:
73
    blocked:
74
      modules:
75
        - github.com/go-errors/errors:
76
            recommendations:
77
              - github.com/pkg/errors
78
        - github.com/ghodss/yaml:
79
            recommendations:
80
              - sigs.k8s.io/yaml
81
        - gopkg.in/yaml.v2:
82
            recommendations:
83
              - sigs.k8s.io/yaml
84
        - gopkg.in/yaml.v3:
85
            recommendations:
86
              - sigs.k8s.io/yaml
87
        - io/ioutil:
88
            recommandations:
89
              - io
90
              - os
91

92
  misspell:
93
    locale: US
94
    ignore-words:
95
    - cancelled # US English should be "canceled", but this is in the Retry API, so we can't change it.
96
  nonamedreturns:
97
    report-error-in-defer: false
98

99
issues:
100
  fix: true
101
  exclude-rules:
102
    - linters:
103
        - staticcheck
104
      text: 'SA1019: "github.com/golang/protobuf' # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
105
    - linters:
106
        - staticcheck
107
      text: "SA1019: proto.MessageName is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
108
    - linters:
109
        - staticcheck
110
      text: "SA1019: proto.MessageType is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
111
    - linters:
112
        - staticcheck
113
      text: "SA1019: l.UseOriginalDst is deprecated: Do not use." # TODO What is the up-to-date alternative ?
114
    - linters:
115
        - staticcheck
116
      text: "IsIngress is deprecated: use ZoneIngress" # It's deprecated but Kuma still needs to support it for backwards compatibility.
117
    - linters:
118
        - gocritic
119
      text: "appendAssign: append result not assigned to the same slice" # None of the instances of this in Kuma were bugs.
120
    - linters:
121
        - staticcheck
122
      text: "SA1019: package sigs.k8s.io/controller-runtime/pkg/client/fake is deprecated" # https://github.com/kumahq/kuma/issues/2460
123
    - linters:
124
        - staticcheck
125
      text: "SA1019: l.ReusePort is deprecated"
126
    - linters: # AdminPort is deprecated, but it's used to support backwards compatibility
127
        - staticcheck
128
      text: "SA1019: cfg.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
129
    - linters: # AdminPort is deprecated, but it's used to support backwards compatibility
130
        - staticcheck
131
      text: "SA1019: kumaCPConfig.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
132
    - linters: # AdminPort is deprecated, but it's used to support backwards compatibility
133
        - staticcheck
134
      text: "SA1019: c.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
135
    - linters:
136
        - staticcheck
137
      text: "SA1019: .* for new policies use pkg/plugins/policies/xds/cluster.go"
138
    - linters:
139
        - staticcheck
140
      text: "SA1019: .* is deprecated: use MinResyncInterval instead"
141
    - linters:
142
        - staticcheck
143
      text: "SA1019: .* is deprecated: use FullResyncInterval instead"
144

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.