44 modules-download-mode : readonly
55 allow-parallel-runners : true
66linters :
7+ # sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml
78 default : none
89 enable :
910 - asasalint
@@ -47,7 +48,10 @@ linters:
4748 importas :
4849 no-unaliased : true
4950 revive :
51+ # By default, revive will enable only the linting rules that are named in the configuration file.
52+ # So, it's needed to explicitly enable all required rules here.
5053 rules :
54+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
5155 - name : blank-imports
5256 - name : context-as-argument
5357 - name : context-keys-type
@@ -68,6 +72,9 @@ linters:
6872 - name : superfluous-else
6973 - name : unreachable-code
7074 - name : redefines-builtin-id
75+ #
76+ # Rules in addition to the recommended configuration above.
77+ #
7178 - name : bool-literal-in-expr
7279 - name : constant-logical-expr
7380 exclusions :
@@ -78,11 +85,15 @@ linters:
7885 - legacy
7986 - std-error-handling
8087 rules :
88+ # Dot imports for gomega and ginkgo are allowed
89+ # within test files.
8190 - path : _test\.go
8291 text : should not use dot imports
92+ # Ignore error type switch case
8393 - linters :
8494 - errorlint
8595 path : pkg/loader/loader.go
96+ # Ignore test files
8697 - linters :
8798 - dupl
8899 - ginkgolinter
@@ -93,6 +104,7 @@ linters:
93104 - linters :
94105 - exhaustive
95106 path : pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go
107+ # Ignore consider pre-allocating variables
96108 - linters :
97109 - prealloc
98110 text : Consider pre-allocating
0 commit comments