-
Notifications
You must be signed in to change notification settings - Fork 431
/
Copy path.golangci.yml
113 lines (111 loc) · 2.67 KB
/
.golangci.yml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
run:
allow-parallel-runners: true
modules-download-mode: readonly
# Increase the default deadline from 1m as some module operations can take a
# while if uncached!
timeout: 10m
go: "1.23"
linters:
# sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- dogsled
- dupl
- errcheck
- errchkjson
- errorlint
- exhaustive
- ginkgolinter
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosimple
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- nolintlint
- prealloc
- revive
- staticcheck
- stylecheck
- tagliatelle
- typecheck
- unconvert
- unparam
- unused
- whitespace
issues:
exclude-rules:
# Dot imports for gomega and ginkgo are allowed
# within test files.
- path: _test\.go
text: should not use dot imports
# Ignore error type switch case
- path: "pkg/loader/loader.go"
linters:
- errorlint
# Ignore test files
- linters:
- dupl
- ginkgolinter
path: _test\.go
- linters:
- gocritic
path: "pkg/markers/help.go"
- linters:
- exhaustive
path: "pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go"
# Ignore consider pre-allocating variables
- linters:
- prealloc
text: Consider pre-allocating
linters-settings:
govet:
enable-all: true
disable:
- fieldalignment
- shadow
importas:
no-unaliased: true
revive:
# By default, revive will enable only the linting rules that are named in the configuration file.
# So, it's needed to explicitly enable all required rules here.
rules:
# The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
#
# Rules in addition to the recommended configuration above.
#
- name: bool-literal-in-expr
- name: constant-logical-expr