Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
105 lines (89 loc) · 2.65 KB
/
Copy path.golangci.yml
File metadata and controls
105 lines (89 loc) · 2.65 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
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
# golangci-lint configuration
# https://golangci-lint.run/usage/configuration/
run:
timeout: 10m
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
exclude-functions:
- io.Copy
- io.WriteString
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
- (io.Closer).Close
- (*os.File).Close
- (net/http.ResponseWriter).Write
- (*github.com/spf13/cobra.Command).MarkPersistentFlagRequired
- (*github.com/spf13/cobra.Command).MarkFlagRequired
goimports:
local-prefixes: github.com/kfsoftware/hlf-operator
govet:
enable-all: true
disable:
- fieldalignment
- shadow
- nilness
misspell:
locale: US
staticcheck:
checks:
- all
- -SA1019 # Ignore deprecation warnings (many in Fabric SDK)
- -SA4006 # Ignore unused value assignments (many in existing code)
- -SA4009 # Ignore overwritten errors before checking (many in existing code)
- -SA4010 # Ignore unused append results (existing code)
- -SA9003 # Ignore empty branches (existing code)
- -SA9009 # Ignore malformed compiler directives (existing code)
gosec:
excludes:
- G101 # Look for hard coded credentials (too many false positives)
- G104 # Audit errors not checked (covered by errcheck)
- G304 # File path provided as taint input (necessary for operator)
- G401 # Use of weak cryptographic primitive (Fabric SDK uses these)
- G501 # Blocklisted import crypto/md5 (Fabric SDK dependency)
- G505 # Blocklisted import crypto/sha1 (Fabric SDK dependency)
linters:
disable-all: true
enable:
# Default linters
- errcheck
- govet
- staticcheck
# Additional linters
- gofmt
- gosec
- misspell
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-use-default: false
exclude-dirs:
- internal
- pkg/client
exclude:
- "error strings should not be capitalized"
- "error strings should not end with punctuation"
exclude-rules:
# Exclude linters from running on auto-generated files
- path: pkg/client
linters:
- errcheck
# Exclude linters from running on test files
- path: _test\.go
linters:
- errcheck
- gosec
# Exclude linters from generated deep copy files
- path: zz_generated\.deepcopy\.go
linters:
- govet
# Exclude errcheck from kubectl-hlf commands (CLI code with many unchecked writes)
- path: kubectl-hlf/
linters:
- errcheck
# Exclude errcheck from controller code (many pre-existing unchecked errors)
- path: controllers/
linters:
- errcheck