-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
211 lines (179 loc) · 5.87 KB
/
Copy path.golangci.yml
File metadata and controls
211 lines (179 loc) · 5.87 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# GolangCI-Lint v2.5 Configuration for gogpu/ui - Enterprise GUI Toolkit
# Documentation: https://golangci-lint.run/docs/configuration/
version: "2"
run:
timeout: 5m
tests: true
linters:
# Enable comprehensive set of linters for production-quality code
enable:
# Code quality and complexity
- gocyclo # Check cyclomatic complexity
- gocognit # Check cognitive complexity
- funlen # Check function length
- maintidx # Maintainability index
- cyclop # Check cyclomatic complexity (alternative)
- nestif # Reports deeply nested if statements
# Bug detection
- govet # Standard Go vet
- staticcheck # Comprehensive static analysis
- errcheck # Check that errors are handled
- errorlint # Check error wrapping
- gosec # Security issues
- nilnil # Check that functions don't return nil both ways
- nilerr # Check nil error returns
- ineffassign # Detect ineffectual assignments
# Code style and consistency
- misspell # Check for misspelled words
- whitespace # Check for trailing whitespace
- unconvert # Remove unnecessary type conversions
- unparam # Detect unused function parameters
# Naming conventions
- errname # Check error naming conventions
- revive # Fast, configurable, extensible linter
# Performance
- prealloc # Find slice declarations that could be preallocated
- bodyclose # Check HTTP response bodies are closed
- makezero # Find slice declarations with non-zero initial length
# Code practices
- goconst # Find repeated strings that could be constants
- gocritic # Comprehensive code checker
- goprintffuncname # Check printf-like function names
- nolintlint # Check nolint directives are used correctly
- nakedret # Checks for naked returns
# Additional quality checkers
- dupl # Detect duplicate code
- dogsled # Check for assignments with too many blank identifiers
- durationcheck # Check for two durations multiplied together
settings:
govet:
enable:
- copylocks
disable:
- fieldalignment
gocyclo:
# Layout algorithms and widget code can be moderately complex
min-complexity: 20
cyclop:
max-complexity: 20
funlen:
# Widget implementations can be long due to many methods
lines: 120
statements: 60
gocognit:
min-complexity: 30
misspell:
locale: US
nestif:
min-complexity: 4
revive:
rules:
- name: var-naming
- name: error-return
- name: error-naming
- name: if-return
- name: increment-decrement
- name: var-declaration
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- commentFormatting
- whyNoLint
- unnamedResult
- commentedOutCode
- octalLiteral
- paramTypeCombine
settings:
hugeParam:
sizeThreshold: 256
exclusions:
rules:
# Test files - allow more flexibility
- path: _test\.go
linters:
- gocyclo
- cyclop
- funlen
- maintidx
- errcheck
- gosec
- goconst
- dupl
- gocognit
# Widget implementations - many similar methods
- path: widgets/.*\.go
linters:
- funlen # Widget implementations can be long
- dupl # Widget methods are similar by design
# Layout algorithms - complex calculations
- path: layout/.*\.go
linters:
- gocyclo # Layout algorithms can be complex
- cyclop # Flexbox/Grid have many cases
- gocognit # Layout constraint solving
# Internal render pipeline
- path: internal/render/.*\.go
linters:
- funlen # Render batching code can be long
- errcheck # GPU calls often ignore returns
- gosec # GPU memory operations
# Internal platform integration
- path: internal/platform/.*\.go
linters:
- gocyclo # Platform code can be complex
- cyclop # Event dispatchers have many cases
- funlen # Platform code is verbose
- gosec # Platform syscalls are intentional
- errcheck # Platform calls often ignore returns
# Plugin package - name intentionally matches stdlib for discoverability
- path: plugin/.*\.go
linters:
- revive # var-naming: package name conflict is intentional
# Theme implementations - similar structure
- path: theme/.*\.go
linters:
- dupl # Theme variants are similar by design
# Animation engine
- path: animation/.*\.go
linters:
- gocyclo # Animation interpolation can be complex
# Example code - demonstration purposes
- path: examples?/.*\.go
linters:
- errcheck
- errorlint
- funlen
- gocyclo
- cyclop
- gocognit
- godot
- revive
- gosec
- gocritic
# Temporary reproduction scripts (gitignored debug tools)
- path: tmp/.*\.go
linters:
- errcheck
- errorlint
- gosec
- gocritic
- revive
- funlen
- gocyclo
issues:
max-issues-per-linter: 0
max-same-issues: 0
new: false