Skip to content

Commit

Permalink
doc/doc-lint: fix the linting script for new version of mdl
Browse files Browse the repository at this point in the history
The markdown linter now outputs a list of rules in addition to the
error (changed in markdownlint/markdownlint#407).

Update the script to get rid of these, and deal with the now
empty list if all errors are filtered.

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
  • Loading branch information
ru-fu committed Oct 13, 2023
1 parent ff62e51 commit a7d522e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/.sphinx/.markdownlint/doc-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ mdl .tmp/doc -sdoc/.sphinx/.markdownlint/style.rb -udoc/.sphinx/.markdownlint/ru

## Postprocessing

filtered_errors="$(grep -vxFf doc/.sphinx/.markdownlint/exceptions.txt .tmp/errors.txt)"
if [ "$(echo "$filtered_errors" | wc -l)" = "2" ]; then
sed -i '/^$/,$d' .tmp/errors.txt

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

if [ -z "$filtered_errors" ]; then
echo "Passed!"
exit 0
else
Expand Down

0 comments on commit a7d522e

Please sign in to comment.