Skip to content

Commit

Permalink
Merge pull request #13485 from simondeziel/make-doc
Browse files Browse the repository at this point in the history
github: run the doc link checker on PRs only
  • Loading branch information
tomponline committed May 17, 2024
2 parents affed4e + 20f675d commit a564550
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ jobs:
woke-args: "*.md **/*.md -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml"

- name: Run link checker
# Run link checker on PRs only
if: ${{ github.event_name != 'push' }}
run: |
set -eux
make doc-linkcheck
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ doc-objects:

.PHONY: doc-serve
doc-serve:
cd doc/html; python3 -m http.server 8001
cd doc/html; python3 -m http.server --bind 127.0.0.1 8001

.PHONY: doc-spellcheck
doc-spellcheck: doc
Expand Down
8 changes: 8 additions & 0 deletions doc/.sphinx/.markdownlint/doc-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ mdl .tmp/doc -sdoc/.sphinx/.markdownlint/style.rb -udoc/.sphinx/.markdownlint/ru

sed -i '/^$/,$d' .tmp/errors.txt

# Check for unneeded exceptions
unneeded_exceptions="$(grep -vxFf .tmp/errors.txt doc/.sphinx/.markdownlint/exceptions.txt)" || true
if [ -n "${unneeded_exceptions}" ]; then
echo "Failed due to unneeded exceptions rules!"
echo "${unneeded_exceptions}"
exit 1
fi

filtered_errors="$(grep -vxFf doc/.sphinx/.markdownlint/exceptions.txt .tmp/errors.txt)" || true

if [ -z "$filtered_errors" ]; then
Expand Down
1 change: 0 additions & 1 deletion doc/.sphinx/.markdownlint/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
.tmp/doc/howto/network_forwards.md:73: MD005 Inconsistent indentation for list items at the same level
.tmp/doc/howto/network_forwards.md:67: MD032 Lists should be surrounded by blank lines
.tmp/doc/howto/network_forwards.md:72: MD032 Lists should be surrounded by blank lines
.tmp/doc/contributing.md:9: MD002 First header should be a top level header

0 comments on commit a564550

Please sign in to comment.