BlueGit

timfa 66wiki

add pipeline check to ensure problems like longsword file don't repeat

timfa Tim · pushed by timfa

Authored 2025-12-23 · 10 months ago

Hash
b3bd1843ae588892c41d60a3accc56e952a3001c
Parent
126130ad
1 file changed +13 −0
.gitlab-ci.yml +13 −0
@@ -37,6 +37,19 @@ validate_json:
37 37 print(f"ERROR: templates directory not found: {templates_dir.resolve()}")
38 38 sys.exit(1)
39 39
40 # NEW: ensure all files under /data are .json (no other extensions, no extensionless files)
41 bad_files = []
42 for p in sorted(data_dir.rglob("*")):
43 if p.is_file() and p.suffix.lower() != ".json":
44 bad_files.append(p.as_posix())
45
46 if bad_files:
47 print("\nDATA DIRECTORY VALIDATION FAILED\n")
48 print("ERROR: Non-JSON files found under web/data (only .json allowed):")
49 for bf in bad_files:
50 print(" - " + bf)
51 sys.exit(1)
52
40 53 json_files = sorted(data_dir.rglob("*.json"))
41 54 if not json_files:
42 55 print(f"ERROR: No .json files found under {data_dir}")
@@ -37,6 +37,19 @@ validate_json:
37 print(f"ERROR: templates directory not found: {templates_dir.resolve()}")
37 print(f"ERROR: templates directory not found: {templates_dir.resolve()}")
38 sys.exit(1)
38 sys.exit(1)
39
39
40 # NEW: ensure all files under /data are .json (no other extensions, no extensionless files)
41 bad_files = []
42 for p in sorted(data_dir.rglob("*")):
43 if p.is_file() and p.suffix.lower() != ".json":
44 bad_files.append(p.as_posix())
45
46 if bad_files:
47 print("\nDATA DIRECTORY VALIDATION FAILED\n")
48 print("ERROR: Non-JSON files found under web/data (only .json allowed):")
49 for bf in bad_files:
50 print(" - " + bf)
51 sys.exit(1)
52
40 json_files = sorted(data_dir.rglob("*.json"))
53 json_files = sorted(data_dir.rglob("*.json"))
41 if not json_files:
54 if not json_files:
42 print(f"ERROR: No .json files found under {data_dir}")
55 print(f"ERROR: No .json files found under {data_dir}")