summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-08-08 14:42:20 +0200
committerwinniehell <git@winniehell.de>2016-08-09 00:21:10 +0200
commita361f314f8f7f00a7541a5af1b8a2a92ced475e9 (patch)
tree6e9ccf10b8cc0922b9254d85c1f16f0cb3d7de1a
parentfb20758f1eb0f9a0b27e8c4d804b5af80908f629 (diff)
downloadgitlab-ce-a361f314f8f7f00a7541a5af1b8a2a92ced475e9.tar.gz
add linting script for documentation
-rw-r--r--.gitlab-ci.yml7
-rwxr-xr-xscripts/lint-doc.sh15
2 files changed, 22 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8da9acf9066..4f118288902 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
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
+