#! /bin/sh
#
# Rudimentary lint check for the documentation.
DOCS_WITH_TRAILING_SPACES="$(
    find docs -name '*.rst' -not -path 'docs/_autosummary/*' -print0 |
    xargs -r0 grep -l '[[:space:]]$')"
if [ -n "$DOCS_WITH_TRAILING_SPACES" ]
then
    echo "Trailing spaces in documentation:\n$DOCS_WITH_TRAILING_SPACES" >&2
    exit 1
fi
