@@ -42,7 +42,6 @@ linters:
4242 - nakedret # Naked returns in long functions
4343 - nilerr # Return nil after error check
4444 - noctx # HTTP requests without context
45- - prealloc # Slice preallocation
4645 - predeclared # Shadowing predeclared identifiers
4746 - revive # Replacement for golint
4847 - unconvert # Unnecessary conversions
@@ -55,18 +54,22 @@ linters:
5554 - gocognit # Cognitive complexity - use judiciously
5655 - gocyclo # Cyclomatic complexity - use judiciously
5756 - lll # Line length - gofmt handles wrapping
57+ - prealloc # Micro-optimization not worth verbosity for typical data volumes
5858
5959linters-settings :
6060 dupl :
6161 threshold : 150 # Tokens before flagging duplication
6262
6363 errcheck :
6464 check-type-assertions : true
65- check-blank : true
65+ check-blank : false # Allow explicit _ = for intentionally ignored errors
6666 exclude-functions :
6767 - io.Copy
6868 - io.ReadAll
6969 - (io.ReadCloser).Close
70+ - (*encoding/json.Encoder).Encode # Response encoding to http.ResponseWriter
71+ - (*github.com/docker/docker/client.Client).Close
72+ - (*io.SectionReader).Seek
7073
7174 errorlint :
7275 errorf : true
@@ -81,19 +84,26 @@ linters-settings:
8184 min-occurrences : 3
8285
8386 gocritic :
87+ # Only enable diagnostic and performance checks, not style
88+ # This avoids the opinionated style checks (ifElseChain, octalLiteral, etc.)
8489 enabled-tags :
8590 - diagnostic
86- - style
8791 - performance
8892 disabled-checks :
89- - whyNoLint # Sometimes we need nolint without explanation
93+ - hugeParam # Performance but often intentional for immutability
94+ - rangeValCopy # Performance but clarity often trumps micro-optimization
95+ - ifElseChain # Diagnostic but if-else chains are often clearer than switch
96+ - elseif # Diagnostic but sometimes nested else-if is clearer
97+ - appendCombine # Performance but explicit appends are clearer
98+ - commentedOutCode # Diagnostic but sometimes useful for documentation
9099
91100 goimports :
92101 local-prefixes : gitlab.bluewillows.net
93102
94103 gosec :
95104 excludes :
96105 - G104 # Errors unhandled - errcheck covers this
106+ - G115 # Integer overflow conversion - API values are validated
97107 - G304 # File path from variable - often intentional
98108
99109 govet :
@@ -121,13 +131,15 @@ linters-settings:
121131 - name : error-strings
122132 - name : error-naming
123133 - name : exported
134+ disabled : true # Too strict about stuttering names in public API
124135 - name : increment-decrement
125136 - name : indent-error-flow
126137 - name : package-comments
127138 - name : range
128139 - name : receiver-naming
129140 - name : time-naming
130141 - name : unexported-return
142+ disabled : true # Intentional pattern: exported methods with unexported return types for internal clients
131143 - name : var-declaration
132144 - name : var-naming
133145
@@ -146,6 +158,9 @@ issues:
146158 - dupl
147159 - gosec
148160 - goconst
161+ - errcheck # Tests often intentionally ignore errors
162+ - govet # unusedwrite in test setup is acceptable
163+ - unparam # Test helpers may have "future-proofed" parameters
149164
150165 # Allow fmt.Print in main for CLI output
151166 - path : cmd/
@@ -165,11 +180,29 @@ issues:
165180 - unparam
166181
167182 # Provider implementations may have similar patterns
183+ - path : providers/
184+ linters :
185+ - goconst # Provider name strings are intentional literals
168186 - path : providers/
169187 linters :
170188 - dupl
171189 text : " duplicate of"
172190
191+ # Reconciler has intentional similar delete loops for different contexts
192+ - path : internal/reconciler/
193+ linters :
194+ - dupl
195+
196+ # Config validation uses inline strings in switch cases for clarity
197+ - path : internal/config/
198+ linters :
199+ - goconst
200+
201+ # Webhook client closes body in doRequest - linter doesn't see it
202+ - path : providers/webhook/client.go
203+ linters :
204+ - bodyclose
205+
173206severity :
174207 default-severity : warning
175208 rules :
0 commit comments