-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path.golangci.yml
More file actions
75 lines (72 loc) · 2.23 KB
/
Copy path.golangci.yml
File metadata and controls
75 lines (72 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "2"
run:
timeout: 5m
linters:
default: none
enable:
- gocritic
- govet
- ineffassign
- misspell
- revive
- staticcheck
- unused
settings:
revive:
rules:
# Enable a sensible subset; Plan 6 will tighten via a dedicated config.
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: increment-decrement
- name: indent-error-flow
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
exclusions:
rules:
- path: zz_generated.*\.go
linters: [staticcheck, revive, gocritic]
- path: _test\.go
linters: [revive]
text: 'dot-imports'
- path: _test\.go
linters: [staticcheck]
text: 'ST1001'
- path: test/
linters: [staticcheck]
text: 'ST1001'
# Tolerate deprecated controller-runtime / k8s API surfaces across
# api/v1, cmd/, and internal/controller/. The k8s 0.36 / controller-
# runtime 0.24 bump deprecated several APIs we still use:
# - admission.CustomDefaulter / CustomValidator (use Defaulter[T] / Validator[T])
# - ctrl.NewWebhookManagedBy builder methods (use the typed variants)
# - mgr.GetEventRecorderFor (use GetEventRecorder)
# - client.Apply (use client.Client.Apply())
# - fieldsV1.Raw direct access (use GetRawBytes / GetRawString)
# - corev1.ServiceExternalTrafficPolicyType (use ServiceExternalTrafficPolicy)
# - scheme.Builder
# The deprecated forms still work for v1.0; migrating to the typed
# equivalents is tracked as a v1.1 cleanup.
- path: (api/v1|cmd|internal/(controller|webhook))/
linters: [staticcheck]
text: 'SA1019'
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/paperclipinc/hermes-operator