Skip to content

Commit

Permalink
Ignore false-positive github link errors (#146)
Browse files Browse the repository at this point in the history
* Ignore false github link errors

* Remove tmp logfile

* Remove logfile

* Move cleanup to bash script
  • Loading branch information
christophfroehlich authored Aug 14, 2023
1 parent f312a84 commit f3163a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ linkcheck-all-subrepos-with-api: Makefile
@echo Step 3: Cloning all subrepositories again
./make_help_scripts/add_sub_repos
@echo Step 4: Check links
cp -r $(BUILDDIR)/html/doc/api/. doc/api/
make linkcheck
rm -rf doc/api/
./make_help_scripts/check_links $(BUILDDIR)

multiversion: Makefile
@echo Building multi version documentation without API
Expand Down
22 changes: 22 additions & 0 deletions make_help_scripts/check_links
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# This script is used to check the links in the ROS documentation.
# due to a bug in the sphinx linkchecker, github anchors are false positives and
# have to be explicitly ignored
# https://github.com/sphinx-doc/sphinx/issues/9016

LOGFILE="linkcheck.log"
cleanup () {
rm "$LOGFILE"
rm -rf doc/api/
}

cp -r $1/html/doc/api/. doc/api/
make linkcheck > "$LOGFILE"
if grep broken "$LOGFILE" | grep -v -E 'github.*Anchor'; then
num_broken=$(grep broken "$LOGFILE" | grep -v -E 'github.*Anchor' | wc -l)
echo "Broken links found: $num_broken"
cleanup
exit 1
fi
cleanup
exit 0

0 comments on commit f3163a1

Please sign in to comment.