|
20 | 20 | import argparse |
21 | 21 | parser = argparse.ArgumentParser() |
22 | 22 | 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") |
23 | 24 | args = parser.parse_args() |
24 | 25 |
|
25 | 26 | api_url = os.environ.get('APPVEYOR_API_URL') |
@@ -366,6 +367,10 @@ def parse(filename): |
366 | 367 | for udl in udlfile["UDLs"]: |
367 | 368 | print("- " + udl["display-name"]) |
368 | 369 |
|
| 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 | + |
369 | 374 | # false fail from PR #317 should have been caught by a github repo that wasn't using raw URL, but didn't |
370 | 375 | # so my other checks still weren't enough |
371 | 376 | if udl["repository"] != "" and "github.com" in udl["repository"]: |
@@ -493,7 +498,7 @@ def parse(filename): |
493 | 498 | ac_link = udl_internal_name + ".xml" |
494 | 499 |
|
495 | 500 | # 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(): |
497 | 502 | 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') |
498 | 503 |
|
499 | 504 | # audit internal name vs autoCompletion text name: MUST match |
|
0 commit comments