From b4452f3db65e26d46affa9ba9a25032cdfbdd49c Mon Sep 17 00:00:00 2001 From: Rick Calixte <10281587+rcalixte@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:47:55 -0400 Subject: [PATCH] Add additional checks during validation (#1267) --- validate-spice | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/validate-spice b/validate-spice index 96d5b58ec..72154ec6c 100755 --- a/validate-spice +++ b/validate-spice @@ -1,4 +1,5 @@ #!/usr/bin/python3 +import glob import json import os import sys @@ -27,6 +28,15 @@ def validate_xlet(uuid): if not os.path.exists(file): raise CheckError("[%s] Missing file: %s" % (uuid, file)) + # Check if there are any improperly placed files + for file in glob.glob("*"): + if file.endswith(".po") or file.endswith(".pot"): + raise CheckError(f"[{uuid}] Invalid location for translation files!") + + # Check if there is an improperly duplicated file + if len(glob.glob("files/*/po/*.pot")) > 1: + raise CheckError(f"[{uuid}] Too many .pot files!") + found = False for root, dirs, files in os.walk("files/%s" % uuid): if any(ext.endswith(".po") for ext in files) and not any(ext.endswith(".pot") for ext in files):