From 98f3a7066e1aa9701fe1d4c89b046fe03b2420e5 Mon Sep 17 00:00:00 2001 From: Jerop Kipruto Date: Mon, 23 Jun 2025 17:19:40 -0400 Subject: refactor: rename `disableDataCollection` to `dataCollectionEnabled` (#1319) Renames the `disableDataCollection` flag to the more intuitive and positive `dataCollectionEnabled`. This change improves code clarity by avoiding double negatives and making the purpose of the flag more direct. The logic has been inverted wherever the flag is used to accommodate the new naming convention. Using a suffix like `"Enabled"` follows a common convention that improves readability. - A condition like `if (dataCollectionEnabled)` reads like a natural language sentence ("if data collection is enabled"), which reduces cognitive load. - Distinguishes the boolean flag (representing a state) from potential functions that would perform an action (e.g., `enableDataCollection()` or `disableDataCollection()`), avoiding ambiguity between checking a value and calling a function. #750 --- packages/cli/src/ui/hooks/useToolScheduler.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/cli/src/ui/hooks/useToolScheduler.test.ts') diff --git a/packages/cli/src/ui/hooks/useToolScheduler.test.ts b/packages/cli/src/ui/hooks/useToolScheduler.test.ts index 4c8901dc..69d72cdc 100644 --- a/packages/cli/src/ui/hooks/useToolScheduler.test.ts +++ b/packages/cli/src/ui/hooks/useToolScheduler.test.ts @@ -48,7 +48,7 @@ const mockToolRegistry = { const mockConfig = { getToolRegistry: vi.fn(() => mockToolRegistry as unknown as ToolRegistry), getApprovalMode: vi.fn(() => ApprovalMode.DEFAULT), - getDisableDataCollection: () => false, + getUsageStatisticsEnabled: () => true, }; const mockTool: Tool = { -- cgit v1.2.3