summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2020-12-21 14:35:12 -0500
committerShaun McCance <shaunm@redhat.com>2020-12-21 14:35:12 -0500
commit4f5004e41ff9933b70a0b7333ce17642c6427a80 (patch)
tree5da2f74b6347a9f87dbc38dd28c720d64f3abb7a
parent735d91c04577cad8b861ecb28428516b5b2a8ac1 (diff)
downloadyelp-tools-4f5004e41ff9933b70a0b7333ce17642c6427a80.tar.gz
yelp-check.py: Add allow list to `yelp-check hrefs`
-rw-r--r--tools/yelp-check.py9
1 files changed, 8 insertions, 1 deletions
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: