Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/appysetty/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ def parse_value_from_string(value: str, value_type: object) -> object:

if value_type is bool:
normalized = trimmed.lower()
return normalized in {"true", "1", "yes", "on"}
if normalized in {"true", "1", "yes", "on"}:
return True
elif normalized in {"false", "0", "no", "off"}:
return False
else:
raise AppConfigError(
f"invalid boolean value {normalized} - allowed are true/false, 1/0, yes/no, on/off"
)

raise AppConfigError(f"Unsupported configuration type {value_type}")

Expand Down
Loading