From 2c52e9c91d6c10a48bba36d1f96974af5f5b8c83 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 23:57:08 +0100 Subject: [PATCH] Update to linkchecker (#346) (#349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don't check gazebosim.org 404 error * use linkcheck_anchors_ignore_for_url for github instead of ignoring it (cherry picked from commit 6cc9559fd1cfbdc8f1cc974a5d0804092cbc25e8) Co-authored-by: Christoph Fröhlich --- conf.py | 8 ++++++++ make_help_scripts/check_links.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 42914b6e16e..be614172503 100644 --- a/conf.py +++ b/conf.py @@ -168,6 +168,14 @@ github_url = "https://github.com/ros-controls/control.ros.org" +# -- linkchecker options ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#filtering +linkcheck_anchors_ignore_for_url = [ + 'https://github.com/', + 'https://index.ros.org/' + ] +linkcheck_ignore = [r'https://gazebosim.org/home'] + # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. diff --git a/make_help_scripts/check_links.py b/make_help_scripts/check_links.py index 0fbe18d6008..d6a1d9ca7af 100755 --- a/make_help_scripts/check_links.py +++ b/make_help_scripts/check_links.py @@ -50,7 +50,7 @@ def main(): # Check for broken links with open(LOGFILE, "r") as logfile: broken_links = [ - line for line in logfile if "broken" in line and "github" not in line and "vimeo" not in line] + line for line in logfile if 'broken' in line] if broken_links: num_broken = len(broken_links)