Skip to content

Commit 299c35d

Browse files
committed
Enforce no-spaces-in-UDL-filename rule
and update three UDL that violated that rule
1 parent 881ea32 commit 299c35d

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

.validators/validator_json.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import argparse
2121
parser = argparse.ArgumentParser()
2222
parser.add_argument("-o", "--output-md", help="output new copy of udl-list.md", action="store_true")
23+
parser.add_argument("-w", "--warn-on-mismatch", help="output warning if mismatch between internal name and display-name", action="store_true")
2324
args = parser.parse_args()
2425

2526
api_url = os.environ.get('APPVEYOR_API_URL')
@@ -366,6 +367,10 @@ def parse(filename):
366367
for udl in udlfile["UDLs"]:
367368
print("- " + udl["display-name"])
368369

370+
# check for spaces in JSON id-name:
371+
if " " in udl["id-name"]:
372+
post_error(f'Found space in JSON "id-name": "{udl["id-name"]}": Must use alternative to space, like underscores, hyphens, periods, or CamelCase')
373+
369374
# false fail from PR #317 should have been caught by a github repo that wasn't using raw URL, but didn't
370375
# so my other checks still weren't enough
371376
if udl["repository"] != "" and "github.com" in udl["repository"]:
@@ -493,7 +498,7 @@ def parse(filename):
493498
ac_link = udl_internal_name + ".xml"
494499

495500
# audit internal name vs display-name name: recommend to match
496-
if udl_internal_name.casefold() != udl["display-name"].casefold():
501+
if args.warn_on_mismatch and udl_internal_name.casefold() != udl["display-name"].casefold():
497502
print(f' ! WARNING: XML:<UserLang name="{udl_internal_name}"> is different than JSON:{{"display-name": "{udl["display-name"]}"}}: CONTRIBUTING.md recommends those two should match if possible')
498503

499504
# audit internal name vs autoCompletion text name: MUST match

udl-list.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@
10001000
"autoCompletionAuthor": "generate_ac.py"
10011001
},
10021002
{
1003-
"id-name": "eCon Studio_byMichaelSzabo",
1003+
"id-name": "eConStudio_byMichaelSzabo",
10041004
"display-name": "eConScript",
10051005
"version": "20260211",
10061006
"repository": "",
@@ -3032,7 +3032,7 @@
30323032
"autoCompletionAuthor": "generate_ac.py"
30333033
},
30343034
{
3035-
"id-name": "SBI Mapper",
3035+
"id-name": "SBI_Mapper_Light_Mode",
30363036
"display-name": "IBM SBI Mapper Extended Rules",
30373037
"sample": "IBM_SBI_mapper_example.txt",
30383038
"version": "20240527",
@@ -3043,7 +3043,7 @@
30433043
"autoCompletionAuthor": "generate_ac.py"
30443044
},
30453045
{
3046-
"id-name": "SBI Mapper (Dark Mode)",
3046+
"id-name": "SBI_Mapper_Dark_Mode",
30473047
"display-name": "IBM SBI Mapper Extended Rules (Dark Mode)",
30483048
"version": "20240527",
30493049
"sample": "IBM_SBI_mapper_example.txt",

0 commit comments

Comments
 (0)