diff options
| author | Jarka Kadlecova <jarka@gitlab.com> | 2017-10-03 09:37:48 +0200 |
|---|---|---|
| committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-10-03 09:37:48 +0200 |
| commit | c488bcd13e6e0405d990608c8695ffabe17ffcae (patch) | |
| tree | 7c1e07081e8ccf88fef05a368a8c5bc4d87ceb55 /scripts/lint-doc.sh | |
| parent | 59a6f15cd22621826116446d5f28753c973ba2d1 (diff) | |
| parent | bdc50ed779cb0c7d266c0f80f3e66a25da8b1964 (diff) | |
| download | gitlab-ce-c488bcd13e6e0405d990608c8695ffabe17ffcae.tar.gz | |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into 18608-lock-issues-v2
# Conflicts:
# db/schema.rb
Diffstat (limited to 'scripts/lint-doc.sh')
| -rwxr-xr-x | scripts/lint-doc.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh index 54c1ef3dfdd..e5242fee32b 100755 --- a/scripts/lint-doc.sh +++ b/scripts/lint-doc.sh @@ -3,15 +3,19 @@ cd "$(dirname "$0")/.." # Use long options (e.g. --header instead of -H) for curl examples in documentation. -grep --extended-regexp --recursive --color=auto 'curl (.+ )?-[^- ].*' doc/ +echo 'Checking for curl short options...' +grep --extended-regexp --recursive --color=auto 'curl (.+ )?-[^- ].*' doc/ >/dev/null 2>&1 if [ $? == 0 ] then - echo '✖ ERROR: Short options should not be used in documentation!' >&2 + echo '✖ ERROR: Short options for curl should not be used in documentation! + Use long options (e.g., --header instead of -H):' >&2 + grep --extended-regexp --recursive --color=auto 'curl (.+ )?-[^- ].*' doc/ exit 1 fi # Ensure that the CHANGELOG.md does not contain duplicate versions DUPLICATE_CHANGELOG_VERSIONS=$(grep --extended-regexp '^## .+' CHANGELOG.md | sed -E 's| \(.+\)||' | sort -r | uniq -d) +echo 'Checking for CHANGELOG.md duplicate entries...' if [ "${DUPLICATE_CHANGELOG_VERSIONS}" != "" ] then echo '✖ ERROR: Duplicate versions in CHANGELOG.md:' >&2 @@ -19,5 +23,15 @@ then exit 1 fi +# Make sure no files in doc/ are executable +EXEC_PERM_COUNT=$(find doc/ app/ -type f -perm 755 | wc -l) +echo 'Checking for executable permissions...' +if [ "${EXEC_PERM_COUNT}" -ne 0 ] +then + echo '✖ ERROR: Executable permissions should not be used in documentation! Use `chmod 644` to the files in question:' >&2 + find doc/ app/ -type f -perm 755 + exit 1 +fi + echo "✔ Linting passed" exit 0 |
