From 80763ed1eae2290af4023fedf46d56c51e33909b Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Sun, 9 Aug 2020 17:10:26 +0100 Subject: [PATCH] Add slack to the list of ignored schemes slack:// is a way to interact with a local Slack client [1], and is not something that LinkChecker can check. [1] https://api.slack.com/reference/deep-linking#client --- linkcheck/checker/unknownurl.py | 2 +- scripts/update_iana_uri_schemes.py | 3 ++- setup.cfg | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/linkcheck/checker/unknownurl.py b/linkcheck/checker/unknownurl.py index 15101818..c811a439 100644 --- a/linkcheck/checker/unknownurl.py +++ b/linkcheck/checker/unknownurl.py @@ -392,6 +392,7 @@ ignored_schemes_other = r""" |find # Mozilla specific |isbn # ISBN (int. book numbers) |javascript # JavaScript +|slack # Slack Technologies client """ ignored_schemes = "^(%s%s%s%s)$" % ( @@ -403,4 +404,3 @@ ignored_schemes = "^(%s%s%s%s)$" % ( ignored_schemes_re = re.compile(ignored_schemes, re.VERBOSE) is_unknown_scheme = ignored_schemes_re.match - diff --git a/scripts/update_iana_uri_schemes.py b/scripts/update_iana_uri_schemes.py index 3e5544cc..66061ce4 100644 --- a/scripts/update_iana_uri_schemes.py +++ b/scripts/update_iana_uri_schemes.py @@ -15,6 +15,7 @@ iana_uri_schemes_other = { "find": "Mozilla specific", "isbn": "ISBN (int. book numbers)", "javascript": "JavaScript", + "slack": "Slack Technologies client", } filter_uri_schemes_permanent = ( @@ -77,7 +78,7 @@ def main(args): other=get_regex(iana_uri_schemes_other), ) res = template % args - print(res) + print(res.rstrip()) return 0 diff --git a/setup.cfg b/setup.cfg index 5f733dd2..388aa619 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,8 @@ per-file-ignores = tests/__init__.py: F401 # E501: line too long linkcheck/ftpparse.py: E501 + linkcheck/checker/unknownurl.py: E501 + scripts/update_iana_uri_schemes.py: E501 tests/test_ftpparse.py: E501 # F821 undefined name # https://github.com/PyCQA/pyflakes/issues/548