From b77f8d91aaa8a1c69ee843d63de6b38b34d26677 Mon Sep 17 00:00:00 2001 From: Matt Venn Date: Fri, 18 Nov 2022 12:34:23 +0100 Subject: [PATCH] make sure discord handle is complete --- configure.py | 7 +++++++ info.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 2d07eb61..123d3cb5 100755 --- a/configure.py +++ b/configure.py @@ -93,6 +93,13 @@ def check_docs(yaml): logging.error("missing value for {} in documentation".format(key)) exit(1) + # if provided, check discord handle is valid + if len(yaml['documentation']['discord']): + parts = yaml['documentation']['discord'].split('#') + if len(parts) != 2 or len(parts[0]) == 0 or not re.match('^[0-9]{4}$', parts[1]): + logging.error(f'Invalid format for discord username') + exit(1) + def get_top_module(yaml): wokwi_id = int(yaml['project']['wokwi_id']) diff --git a/info.yaml b/info.yaml index 53ef9af3..482c1123 100644 --- a/info.yaml +++ b/info.yaml @@ -15,7 +15,7 @@ project: # This info will be automatically collected and used to make a datasheet for the chip. documentation: author: "" # Your name - discord: "" # Your discord handle + discord: "" # Your discord handle - make sure to include the # part as well title: "" # Project title description: "" # Short description of what your project does how_it_works: "" # Longer description of how the project works