Commit fa7440a
lint: delete pre-existing dead helpers instead of suppressing them
Per review feedback: //nolint:unused directives on 28 pre-existing helpers (funcs, methods, vars, types, consts, struct field) were masking dead code rather than fixing it. Removed each helper after verifying zero callers within its declaring package (the unused linter is package-scoped and these are all unexported, so cross-package callers are impossible by construction).
Deleted symbols (20 files / 403 lines net removed):
internal/ai/rag/pgvector.go isProviderGateClosed
internal/api/automation_handler_test_run checkWebhookTokenUniqueness, errWebhookTokenDuplicate, duplicateTokenError, (*duplicateTokenError).Error
internal/api/battery_cells_handler.go frontendCell type
internal/api/battery_handler.go nominalRangeKm const
internal/api/chatbot_handler.go (*ChatbotHandler).queryVehicleLocation
internal/api/export_handler.go ptrFloatMpsToMphAPI, ptrInt16
internal/api/middleware.go tracedTransport
internal/api/polling_handler.go writeJSONPolling
internal/api/share_handler.go (*ShareHandler).buildFromTelemetry
internal/api/telemetry_handler.go toBool, parseBuckleStatus, toTimestamp, (*TelemetryHandler).trackVehicleConfig, formatSignalName (+ var _ trick); also stale Phase-42 comments referencing deleted trackSecurity/trackUserPreferences
internal/api/telemetry_sessions_signal_helpers.go derefInt16AsInt
internal/api/vehicle_settings_handler.go drainBody
internal/api/watch_handler.go derefInt
internal/automation/engine.go Engine.mu field
internal/database/settings_serializer.go ptrInt64Eq
internal/database/sudo_token_repo.go (*SudoTokenStore).withClock
internal/database/tesla_energy_history_repo.go validJSON (+ orphan Helpers section header)
internal/export/processor.go ptrInt, ptrInt16
internal/fsm/machine.go (*VehicleFSM).buildSignalContext
internal/fsm/transition.go guardNames
Also pruned the now-unused imports surfaced by the deletions:
pgvector.go drops 'errors'; engine.go drops 'sync'; chatbot_handler.go drops 'strings'; polling_handler.go drops 'encoding/json'; telemetry_handler.go drops 'strconv', 'strings', 'github.com/rs/zerolog/log'; vehicle_settings_handler.go drops 'io'; tesla_energy_history_repo.go drops 'encoding/json'.
Verification (matches the CI matrix):
go build ./... ✓ go vet ./... ✓ golangci-lint run ./... ✓ (0 issues)
go test ./... ✓ all 157 packages archmetrics -compare baseline.json ✓
npx tsc --noEmit ✓ (frontend untouched)
Net effect: zero behavioural change, 28 //nolint:unused suppressions gone, no //nolint:unused // pre-existing directives remain anywhere in the tree.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 87bd0a5 commit fa7440a
20 files changed
Lines changed: 0 additions & 403 deletions
File tree
- internal
- ai/rag
- api
- automation
- database
- export
- fsm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 18 | | |
41 | 19 | | |
42 | 20 | | |
| |||
630 | 608 | | |
631 | 609 | | |
632 | 610 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | 611 | | |
645 | 612 | | |
646 | 613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
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 | 87 | | |
126 | 88 | | |
127 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | 158 | | |
170 | 159 | | |
171 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 327 | | |
384 | 328 | | |
385 | 329 | | |
| |||
0 commit comments