From b2b5c2682eeb4dc7fdb062ee883eee1eaf83561d Mon Sep 17 00:00:00 2001 From: Dave Machado Date: Sun, 14 Jan 2018 13:43:19 -0500 Subject: [PATCH] Update validate_format script for CORS --- build/validate_format.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/validate_format.py b/build/validate_format.py index 531aeba6..8066c824 100755 --- a/build/validate_format.py +++ b/build/validate_format.py @@ -8,12 +8,14 @@ anchor = '###' auth_keys = ['apiKey', 'OAuth', 'X-Mashape-Key', 'No'] punctuation = ['.', '?', '!'] https_keys = ['Yes', 'No'] +cors_keys = ['Yes', 'No', 'Unknown'] index_title = 0 index_desc = 1 index_auth = 2 index_https = 3 -index_link = 4 +index_cors = 4 +index_link = 5 errors = [] @@ -91,6 +93,12 @@ def check_format(filename): if https not in https_keys: add_error(line_num, "{} is not a valid HTTPS option".format(https)) # END HTTPS + # START CORS + # values should conform to valid options only + cors = segments[index_cors] + if cors not in cors_keys: + add_error(line_num, "{} is not a valid CORS option".format(cors)) + # END CORS # START Link # url should be wrapped in '[Go!]()' Markdown syntax link = segments[index_link]