diff options
| author | Jerop Kipruto <[email protected]> | 2025-06-23 17:19:40 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-23 21:19:40 +0000 |
| commit | 98f3a7066e1aa9701fe1d4c89b046fe03b2420e5 (patch) | |
| tree | abf73fc75e63121dd04093e8b57db24eb39f0321 /packages/cli/src/ui/hooks/useToolScheduler.test.ts | |
| parent | 4d88054d3526285666f7377875d4774fd6291442 (diff) | |
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
Diffstat (limited to 'packages/cli/src/ui/hooks/useToolScheduler.test.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useToolScheduler.test.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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 = { |
