Fix validator to always print input names with dashes in errors

This commit is contained in:
Dave Rolsky 2025-02-16 10:38:19 -06:00
parent c40b27b8f9
commit 885ad4bc41
No known key found for this signature in database

View File

@ -76,7 +76,9 @@ class InputValidator:
# Validate boolean flags
for flag in boolean_flags:
if flag in self.inputs and self.inputs[flag] not in {"true", "false"}:
validation_errors.append(f"'{flag}' must be either 'true' or 'false'")
# Turn the underscores into dashes
dashes = flag.replace("_", "-")
validation_errors.append(f"'{dashes}' must be either 'true' or 'false'")
# Validate rust-cache-parameters JSON if present
if "rust_cache_parameters" in self.inputs: