Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/mdlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Run `make mdlint` from the root of the repository instead.

# use markdownlint-cli to check for markdown files
docker run --rm -v ./book:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest '**/*.md' --ignore node_modules
# NOTE: we disable MD059 (descriptive-link-text) because it is too strict
docker run --rm -v ./book:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest '**/*.md' --ignore node_modules --disable MD059

# exit code
exit_code=$(echo $?)
Expand All @@ -14,10 +15,10 @@ if [[ $exit_code == 0 ]]; then
echo "All markdown files are properly formatted."
exit 0
elif [[ $exit_code == 1 ]]; then
echo "Exiting with errors. Run 'make mdlint' locally and commit the changes. Note that not all errors can be fixed automatically, if there are still errors after running 'make mdlint', look for the errors and fix manually."
echo "Exiting with errors. Run 'make mdlint' locally and commit the changes. Note that not all errors can be fixed automatically, if there are still errors after running 'make mdlint', look for the errors and fix manually."
docker run --rm -v ./book:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest '**/*.md' --ignore node_modules --fix
exit 1
else
echo "Exiting with exit code >1. Check for the error logs and fix them accordingly."
exit 1
fi
fi
Loading