Skip to content

Commit

Permalink
check if id is present
Browse files Browse the repository at this point in the history
  • Loading branch information
bedroesb committed Jun 27, 2023
1 parent f02f39d commit 7b9d39b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions var/tools_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def remove_prefix(s, prefix):

# Looping over tools
for i, tool in enumerate(all_tools):
if tool['id'] != re.sub('[^0-9a-zA-Z]+', ' ', re.sub("[\(\[].*?[\)\]]", "", tool['id'])).strip().replace(" ", "-").lower():
sys.exit(f"{tool['name']} has an incorrect ID")
if 'id' not in tool.keys() or tool['id'] != re.sub('[^0-9a-zA-Z]+', ' ', re.sub("[\(\[].*?[\)\]]", "", tool['id'])).strip().replace(" ", "-").lower():
sys.exit(f"{tool['name']} has an no or incorrect ID. Make sure the ID is kebab-case and only contains alphanumerical characters.")
tool_name = tool['name']
# Only include keys if there are values:
if 'related_pages' in tool and tool['related_pages']:
Expand Down

0 comments on commit 7b9d39b

Please sign in to comment.