From 4f5004e41ff9933b70a0b7333ce17642c6427a80 Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Mon, 21 Dec 2020 14:35:12 -0500 Subject: yelp-check.py: Add allow list to `yelp-check hrefs` --- tools/yelp-check.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/yelp-check.py b/tools/yelp-check.py index faa25ab..fff3645 100644 --- a/tools/yelp-check.py +++ b/tools/yelp-check.py @@ -260,8 +260,10 @@ class HrefsChecker (Checker): formats = ['docbook4', 'docbook5', 'mallard'] arguments = [ ('help', '-h', None, 'Show this help and exit'), - ('site', '-s', None, 'Treat pages as belonging to a Mallard site') + ('site', '-s', None, 'Treat pages as belonging to a Mallard site'), + ('allow', None, 'URL', 'Allow URL or list of URLs without checking') ] + postblurb = 'URL may be a comma- and/or space-separated list, or specified\nmultiple times.' def main(self, args): if self.parse_args(args) != 0: @@ -277,6 +279,10 @@ class HrefsChecker (Checker): 'http://creativecommons.org/licenses/by-sa/3.0/us/': True, 'https://creativecommons.org/licenses/by-sa/3.0/us/': True } + allow = self.get_option_list('allow') + if allow is not None: + for url in allow: + hrefs[url] = True retcode = 0 for infile in self.iter_files(): @@ -638,6 +644,7 @@ class ValidateChecker (Checker): ('allow', None, 'NS', 'Explicitly allow namespace NS in strict mode'), ('jing', None, None, 'Use jing instead of xmllint for RNG validation') ] + postblurb = 'NS may be a comma- and/or space-separated list, or specified\nmultiple times.' def main(self, args): if self.parse_args(args) != 0: -- cgit v1.2.1