Skip to content

Commit

Permalink
test: Skip link check by default
Browse files Browse the repository at this point in the history
We should run this periodically or put it in a separate job, as it's
causing the tests to fail all the time. I expect those sites may be
blocking github as they see it as a DOS.
  • Loading branch information
purpleidea committed Jul 1, 2024
1 parent 201cf09 commit 5ca9f7f
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions test/test-markdownlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ EOF

#STYLE="test/mdl.style" # style file

LYCHEE=$(command -v lychee 2>/dev/null) || true
if [ -z "$LYCHEE" ]; then
fail_test "The 'lychee' utility can't be found.
Installation guide:
https://github.com/lycheeverse/lychee/blob/master/README.md#installation"
CHECK_LINKS=false
if [ "$1" = "--check-links" ]; then
shift # pop the $1 arg
CHECK_LINKS=true
LYCHEE=$(command -v lychee 2>/dev/null) || true
if [ -z "$LYCHEE" ]; then
fail_test "The 'lychee' utility can't be found.
Installation guide:
https://github.com/lycheeverse/lychee/blob/master/README.md#installation"
fi
fi

find_files() {
Expand All @@ -73,9 +78,11 @@ bad_files=$(
fi
# check links in docs
# if file is from the directory docs/ then check links
if [[ "$i" == docs/* ]] && ! "$LYCHEE" -n "$i" 1>&2; then
echo "$i"
if $CHECK_LINKS; then
# if file is from the directory docs/ then check links
if [[ "$i" == docs/* ]] && ! "$LYCHEE" -n "$i" 1>&2; then
echo "$i"
fi
fi
done
)
Expand Down

0 comments on commit 5ca9f7f

Please sign in to comment.