From a361f314f8f7f00a7541a5af1b8a2a92ced475e9 Mon Sep 17 00:00:00 2001 From: winniehell Date: Mon, 8 Aug 2016 14:42:20 +0200 Subject: add linting script for documentation --- scripts/lint-doc.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/lint-doc.sh (limited to 'scripts/lint-doc.sh') diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh new file mode 100755 index 00000000000..bc6e4d94061 --- /dev/null +++ b/scripts/lint-doc.sh @@ -0,0 +1,15 @@ +#!/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 + +echo "✔ Linting passed" +exit 0 + -- cgit v1.2.1