diff options
Diffstat (limited to 'scripts/lint-doc.sh')
-rwxr-xr-x | scripts/lint-doc.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh index d6dde5744d7..061af911839 100755 --- a/scripts/lint-doc.sh +++ b/scripts/lint-doc.sh @@ -18,6 +18,18 @@ then ((ERRORCODE++)) fi +# Documentation pages need front matter for tracking purposes. +echo '=> Checking documentation for front matter...' +echo +no_frontmatter=$(find doc -name "*.md" -exec head -n1 {} \; | grep -v --count -- ---) +if [ $no_frontmatter -ne 0 ] +then + echo '✖ ERROR: These documentation pages need front matter. See https://docs.gitlab.com/ee/development/documentation/index.html#stage-and-group-metadata for how to add it.' >&2 + find doc -name "*.md" -exec sh -c 'if (head -n 1 "{}" | grep -v -- --- >/dev/null); then echo "{}"; fi' \; 2>&1 + echo + ((ERRORCODE++)) +fi + # Test for non-standard spaces (NBSP, NNBSP) in documentation. echo '=> Checking for non-standard spaces...' echo |