[yelp-tools] yelp-check.py: Add allow list to `yelp-check hrefs`
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-tools] yelp-check.py: Add allow list to `yelp-check hrefs`
- Date: Mon, 21 Dec 2020 19:35:31 +0000 (UTC)
commit 4f5004e41ff9933b70a0b7333ce17642c6427a80
Author: Shaun McCance <shaunm redhat com>
Date: Mon Dec 21 14:35:12 2020 -0500
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 faa25abd..fff3645e 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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]