Add golangci-lint gate and fix its findings

Configure golangci-lint v2 for the whole tree (brlapi/duckdb build tags, curated linters, documented exclusions) and resolve what it reports: dead code, wrapped-error comparisons and %w wrapping, unclosed websocket handshake bodies, staticcheck SA/S items, ineffectual assignments, and explicit _ = discards for best-effort teardown errors. Document the gate in CONTRIBUTING and AGENTS.
This commit is contained in:
hjozwiak committed 2026-11-10 21:13:49 -05:00
1 parent b03cb8917d
commit 0459fb8e50
43 files changed
+166 -112

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ func TestCaptureDesktopRejectsUnavailableAdapterAndCanceledContext(t *testing.T)
if _, err := adapter.CaptureDesktop(canceled); !errors.Is(err, context.Canceled) {
t.Fatalf("canceled capture error = %v", err)
}
if _, err := adapter.CaptureDesktop(nil); err == nil {
if _, err := adapter.CaptureDesktop(nil); err == nil { //nolint:staticcheck // SA1012: verifies nil contexts are rejected
t.Fatal("capture accepted a nil context")
}
}
-4
View File
@@ -71,10 +71,6 @@ func (document DocumentSnapshot) SubtreeEnd(index int) int {
return end
}
func document_entry_error(entry treeEntry) error {
return document_entry_error_tolerating(entry, false)
}
// document_entry_error_tolerating optionally ignores text, geometry, and
// child-order staleness. Caret movement reads text and line bounds live
// from the provider and generation-checks every endpoint, so captured