Skip to content

Commit 86aae58

Browse files
committed
move link checking to link-checker
1 parent 391fd1e commit 86aae58

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ci/install_deps.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [[ "${CONTENT_TESTS:-}" == 1 ]]; then
1313
echo "Installing additional dependencies"
1414

1515
if [[ "${CONTENT_TESTS_LINKS:-}" == 1 ]]; then
16-
gem install html-proofer
16+
pip3 install --user link-checker==0.1.0
1717
fi
1818
cargo install mdbook --vers '0.1.7' --debug
1919
fi

ci/test_script.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ if [[ "${CONTENT_TESTS:-}" == 1 ]]; then
3232
./ci/spellcheck.sh list
3333

3434
if [[ "${CONTENT_TESTS_LINKS:-}" == 1 ]]; then
35-
if [ $(program_installed htmlproofer) == 0 ]; then
36-
echo "Please install htmlproofer: gem install html-proofer"
35+
if [ $(program_installed link-checker) == 0 ]; then
36+
echo "Please install link-checker: 'pip install link-checker'"
3737
exit 1
3838
fi
39-
echo "Checking links"
40-
htmlproofer --empty-alt-ignore ./book/
39+
echo "Checking local links:"
40+
# failing local link test is a hard error as there should be no false possitives
41+
link-checker --no-external ./book/
42+
43+
echo "Checking external links:"
44+
# we do not want to fail on false positives
45+
link-checker --no-local ./book/ --ignore '.*api.github.com*.' || true
4146
fi
4247
else
4348
echo "Testing code snippets"

0 commit comments

Comments
 (0)