add linting script for documentation

This commit is contained in:
winniehell 2016-08-08 14:42:20 +02:00
parent fb20758f1e
commit a361f314f8
2 changed files with 22 additions and 0 deletions

View File

@ -224,6 +224,13 @@ teaspoon:
script:
- teaspoon
lint-doc:
stage: test
image: "phusion/baseimage:latest"
before_script: []
script:
- scripts/lint-doc.sh
bundler:audit:
stage: test
<<: *ruby-static-analysis

15
scripts/lint-doc.sh Executable file
View File

@ -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