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/config/config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/cli/src/config/config.ts') diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index e6f8d423..4e5b0008 100644 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -226,7 +226,8 @@ export async function loadCliConfig( process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? settings.telemetry?.otlpEndpoint, logPrompts: argv.telemetryLogPrompts ?? settings.telemetry?.logPrompts, - disableDataCollection: settings.telemetry?.disableDataCollection ?? false, + usageStatisticsEnabled: + settings.telemetry?.usageStatisticsEnabled ?? true, }, // Git-aware file filtering settings fileFiltering: { -- cgit v1.2.3