-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path.golangci.yml
More file actions
147 lines (128 loc) · 3.78 KB
/
.golangci.yml
File metadata and controls
147 lines (128 loc) · 3.78 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
# golangci-lint configuration file
# Documentation: https://golangci-lint.run/usage/configuration/
# Version of configuration format (required for v2.3.0+)
version: "2"
# Options for analysis running
run:
timeout: 5m
go: "1.24"
modules-download-mode: readonly
# Include test files or not
tests: true
# Linters configuration
linters:
# Enable essential linters
enable:
- dupl
- goconst
- misspell
- staticcheck
- errcheck
- gosec
- revive
- whitespace
- lll
# Exclude specific issues by linter and rule
exclusions:
rules:
# Exclude errcheck issues in test files and UI components (false positives)
- path: test/
linters:
- errcheck
- path: internal/ui/
linters:
- errcheck
- path: internal/vnc/
linters:
- errcheck
- path: internal/config/
linters:
- errcheck
- path: internal/logger/
linters:
- errcheck
# Exclude gosec issues in test files and scripts (intentional)
- path: test/
linters:
- gosec
- path: internal/scripts/
linters:
- gosec
- path: internal/vnc/
linters:
- gosec
- path: pkg/api/
linters:
- gosec
- path: internal/ui/components/
linters:
- gosec
- path: internal/logger/
linters:
- gosec
- path: internal/config/
linters:
- gosec
# Exclude staticcheck issues in test files and style suggestions
- path: test/
linters:
- staticcheck
- linters:
- staticcheck
text: "QF1001: could apply De Morgan's law"
- linters:
- staticcheck
text: "QF1003: could use tagged switch"
- linters:
- staticcheck
text: "QF1008: could remove embedded field"
# Exclude deprecated field warnings for now (we're working on migration)
- linters:
- staticcheck
text: "SA1019: .* is deprecated: legacy single-profile fields for migration"
# Exclude potential nil pointer dereference in tests (acceptable for test code)
- linters:
- staticcheck
text: "SA5011: possible nil pointer dereference"
path: test/
# Exclude hardcoded credentials in test files (acceptable for test code)
- linters:
- gosec
text: "G101: Potential hardcoded credentials"
path: test/
# Exclude unused parameter warnings (interface compliance)
- linters:
- revive
text: "unused-parameter: parameter .* seems to be unused"
# Exclude line length warnings (handled by gofumpt)
- linters:
- lll
text: "The line is .* characters long"
# Exclude whitespace warnings (handled by gofumpt)
- linters:
- whitespace
text: ".*"
# Exclude indent-error-flow warnings (common pattern)
- linters:
- revive
text: "indent-error-flow: if block ends with a return statement"
# Exclude var-naming warnings for now (complex breaking changes)
- linters:
- revive
text: "var-naming:"
# Exclude type stuttering warnings (complex breaking changes)
- linters:
- revive
text: "exported: type name will be used as"
# Exclude package comment warnings (not critical)
- linters:
- revive
text: "package-comments: should have a package comment"
# Exclude exported const/type comment warnings (not critical)
- linters:
- revive
text: "exported: exported .* should have comment"
# Exclude meaningless package name warnings
- linters:
- revive
text: "var-naming: avoid meaningless package names"