Skip to content

Commit

Permalink
Provide a helpful warning message when setting "None" or "none" names…
Browse files Browse the repository at this point in the history
… that are treated as strings
  • Loading branch information
ndejong committed Sep 28, 2024
1 parent 64a5640 commit 5c300a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/env_alias/lib/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def load_definitions(self, definitions_file: Path) -> List[EnvAliasDefinition]:
if not definition_item.get("name"):
definition_item["name"] = definition_key

if definition_item["name"] in ("none", "None"):
_name = definition_item.get("name")
logger.warning(f"Definition name is '{_name}' did you mean 'null' instead?")

try:
definitions.append(EnvAliasDefinition(**definition_item))
except TypeError as e:
Expand Down

0 comments on commit 5c300a0

Please sign in to comment.