Skip to content

Commit 408e171

Browse files
Code review changes: small improvements suggested by Copilot
1 parent 63644a5 commit 408e171

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

linodecli/configuration/config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def plugin_get_value(
254254
return value
255255

256256
if value_type is bool:
257-
return self.parse_boolean(value)
257+
bool_value = self.parse_boolean(value)
258+
return bool_value if bool_value is not None else default
258259

259260
try:
260261
return cast(T, value_type(value))
@@ -691,7 +692,8 @@ def get_custom_aliases(self) -> Dict[str, str]:
691692

692693
def parse_boolean(self, value: str) -> Optional[bool]:
693694
"""
694-
Parses a string config value into a boolean.
695+
Parses a string config value into a boolean. Returns None if the value
696+
cannot be parsed as a boolean.
695697
696698
:param value: The string value to parse.
697699
:return: The parsed boolean value.

0 commit comments

Comments
 (0)