validateAutoUpdateScalar function

void validateAutoUpdateScalar(
  1. Object? value
)

The auto_update scalar validator (issue #1377): true, false or the "notify" string are legal; anything else throws — the same rule CliConfig.fromYaml applies at boot (autoUpdateModeFromYaml, which this file cannot import — it uses dart:io). Pinned to it by unit test (the pins against cli_config.dart group).

Implementation

void validateAutoUpdateScalar(Object? value) {
  // The yaml package hands back plain scalars (older versions wrap them
  // in YamlScalar) — accept both, like the `_scalarKeys` branch above.
  final scalar = value is YamlScalar ? value.value : value;
  if (scalar is bool || scalar == 'notify' || scalar == null) return;
  throw ConfigException(
    '"auto_update" must be true, false, or "notify", got: $scalar',
  );
}