From 3ea11bc5d671d962d01b57fa0fba0bda611025fe Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Mar 2026 08:27:18 +0200 Subject: fix: code quality improvements across lsp, askcli, appconfig, integrationtests - lsp/handlers_completion.go: track collectFirstCompletion goroutine in inflight WaitGroup (goroutine leak fix) - lsp/transport.go: use %w instead of %v for error wrapping - askcli/command_list.go: extract handleListWithFilters shared helper; handleList/handleAll/handleReady are now single-liners - askcli/command_list.go, urgency.go, dep.go: log ParseTaskExport errors to stderr instead of returning 1 silently - appconfig/config_load.go: rename 'any' variable to 'found' to avoid shadowing the built-in identifier - llm/provider.go: add explanatory comment for package-level registry - integrationtests/ask_test.go: add //go:build integration tag; move repoRoot init from init() to TestMain with diagnostic error message Co-Authored-By: Claude Sonnet 4.6 --- integrationtests/ask_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'integrationtests') diff --git a/integrationtests/ask_test.go b/integrationtests/ask_test.go index a762b9d..b0f574f 100644 --- a/integrationtests/ask_test.go +++ b/integrationtests/ask_test.go @@ -1,3 +1,5 @@ +//go:build integration + package integrationtests import ( @@ -17,6 +19,7 @@ import ( "codeberg.org/snonux/hexai/internal/askcli" ) +// repoRoot is set in TestMain before any test runs. var repoRoot string func findRepoRoot() string { @@ -40,10 +43,6 @@ func findRepoRoot() string { return "" } -func init() { - repoRoot = findRepoRoot() -} - func askBinaryPath() string { return filepath.Join(repoRoot, "cmd", "ask", "ask") } @@ -216,7 +215,9 @@ func getTaskInfoRaw(ctx context.Context, uuid string) (string, bool) { } func TestMain(m *testing.M) { + repoRoot = findRepoRoot() if repoRoot == "" { + fmt.Fprintln(os.Stderr, "integration tests: cannot find repo root (go.mod or .git)") os.Exit(1) } // Always rebuild the binary so tests reflect the current source. -- cgit v1.2.3