Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional checks during validation #1267

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions validate-spice
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python3
import glob
import json
import os
import sys
Expand Down Expand Up @@ -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):
Expand Down