diff options
Diffstat (limited to 'scripts/lint-doc.sh')
-rwxr-xr-x | scripts/lint-doc.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh new file mode 100755 index 00000000000..fb4d8463981 --- /dev/null +++ b/scripts/lint-doc.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")/.." + +# Use long options (e.g. --header instead of -H) for curl examples in documentation. +grep --perl-regexp --recursive --color=auto 'curl (.+ )?-[^- ].*' doc/ +if [ $? == 0 ] +then + echo '✖ ERROR: Short options should not be used in documentation!' >&2 + exit 1 +fi + +# Ensure that the CHANGELOG does not contain duplicate versions +DUPLICATE_CHANGELOG_VERSIONS=$(grep --extended-regexp '^v [0-9.]+' CHANGELOG | sed 's| (unreleased)||' | sort | uniq -d) +if [ "${DUPLICATE_CHANGELOG_VERSIONS}" != "" ] +then + echo '✖ ERROR: Duplicate versions in CHANGELOG:' >&2 + echo "${DUPLICATE_CHANGELOG_VERSIONS}" >&2 + exit 1 +fi + +echo "✔ Linting passed" +exit 0 + |